I have a table of data with two columns (A=code 1) and (B = code 2). I have set up a dictionary that returns a category based on the combination of the codes in column A and B. This data dictionary is held for example as (D = code 1), (E = code 2), (F = category). This works fantastic using sumproduct as follows"
=SUMPRODUCT((D2:D10=A2)*(E2:E10=B2)*(F2:F10))
However, in some cases it does not matter what the second code is (code 2) as there is only one category to return based on the first code. In this case, the field for code 2 (column E) would be blank. SUMPRODUCT returns 0 in these instances and not the appropriate category from column F. I have tried entering a wildcard "*" or "N/A" instead of the blank, but it still does not return the correct category.
I can provide sample data if this is unclear. Essentially Code 2 only needs to be looked up, if there is more than 1 entry for code 1 in the dictionary. Thank you very much in advance for any help or direction.
Chris
=SUMPRODUCT((D2:D10=A2)*(E2:E10=B2)*(F2:F10))
However, in some cases it does not matter what the second code is (code 2) as there is only one category to return based on the first code. In this case, the field for code 2 (column E) would be blank. SUMPRODUCT returns 0 in these instances and not the appropriate category from column F. I have tried entering a wildcard "*" or "N/A" instead of the blank, but it still does not return the correct category.
I can provide sample data if this is unclear. Essentially Code 2 only needs to be looked up, if there is more than 1 entry for code 1 in the dictionary. Thank you very much in advance for any help or direction.
Chris