Forum Discussion
Get counts of multiple cells from multiple columns
Hi.
First of all I would create a List with the Ageband entries such as
A;B
0;0
2;2
6;6
11;11
16;16
etc.
This list i would assign an range name such as rngAgeBand
Then i would create a additional column in your coustomers data named AgeBand and would use vlookup
H2 = vlookup(g2;rngAgeBand;2;true)
After that i would create a second additional column Named Status with a if condition to figure out wether its a Employee, Spouse or Children
I2= if(d2="Employee","Employee",if(or(d2 = "son", d2="daughter","Children","Spouse"))
After this little preparation then i would use the countifa function to figure out which amount of each appears in the data list.
Therefore i would convert the list into a table and name the table like tblRawData
b5=countifa(tblRawData[AgeBand],value(mid($a5,6,1)),tblData[Status],B$4)
This hasen't been tested within excel. I just wrote the formulas as i thought they should work like this.
Hope this helps you developing your solution