elihubogan
New Member
- Joined
- May 26, 2011
- Messages
- 3
In context, imagine you have a table with Columns (A) City, (B) State, and (C) Population. I'm familiar with arrays like this to return the population for each city/state combination:
{=SUM(IF((CityA=$A$Column)*(StateB=$B$Column),$C$Column,"Error"))}
When Columns A and B are unique combinations, I've used this as a multiple condition lookup as an alternative to vlookup.
However, when I try to run it where Column C's values are text, not numbers (say the name of the Mayor), obviously the SUM(IF()) won't work. I tried the same function like this:
{=IF((CityA=$A$Column)*(StateB=$B$Column),$C$Column,"Error")}
This is also a fail. Any ideas? I know there are workarounds (create an ID="CityA"&"CityB" then just do =VLOOKUP(ID,$ID$Column,2,false), but I don't like not having a more elegant solution.
{=SUM(IF((CityA=$A$Column)*(StateB=$B$Column),$C$Column,"Error"))}
When Columns A and B are unique combinations, I've used this as a multiple condition lookup as an alternative to vlookup.
However, when I try to run it where Column C's values are text, not numbers (say the name of the Mayor), obviously the SUM(IF()) won't work. I tried the same function like this:
{=IF((CityA=$A$Column)*(StateB=$B$Column),$C$Column,"Error")}
This is also a fail. Any ideas? I know there are workarounds (create an ID="CityA"&"CityB" then just do =VLOOKUP(ID,$ID$Column,2,false), but I don't like not having a more elegant solution.