Column A has values Green, Red, Blue.
Column B has values Circle, Triangle, Square.
Column C has values 1, 2, 3.
What I wish to accomplish is that Column C has a value based on A and B relationship.
Example:
If Column A=Green and B=Circle, then C=1
If Column A=Red and B=Triangle, then C=2
If Column A=Blue and B=Square, then C=3
etc
If A and B have any other combinations, display no value.
I can make work if I use:
=IF(AND(A:A="Green";B:B="Circle");1)
BUT how do I add all conditions in one cell so whatever combination I need is automatically created?
I dont know what to put between two or more IF-clauses.
Semicolon is wrong:
=IF(AND(A:A="Green";B:B="Circle");1);IF(AND(A:A="Red";B:B="Triangle");2)
Any help is very much appreciated.
Cheers
Mafishas
You can't join IF statements quite like that.
You can do:
=IF(AND(A1="Green";B1="Circle");1;IF(AND(A1="Red";B1="Triangle");2;""))
Depending on how many combinations you have you might end with quite a long-winded formula, so it might be worth looking at other ways to get what you're after.
I could be wrong Mafishas but if you start with an AND this should solve it.
I'll investigate.
I used a combination of concatenate and vlookup.
Hope it helps. Stay healthy.
Book1.xlsx
Andrew, I tried your way and all is fine and dandy.
But true, the string is going to be long if there are many variables. Luckily I have <10 and will try it like that for now.
Also, healthyanalyst, will dwell into how you made it happen.
Thanks a bunch.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks