Forum Discussion
You can try this:
=IF(OR(A1="Red",A1="Yellow",A1="Orange",A1="Pink"),1234,IF(A1="Blue",5678,""))
- maddjohn1985Sep 09, 2024Copper Contributor
Thanks, that's worked a treat.
I've now also come across an issue where I need a cell to populate one of 3 values based on the contents of 2 cells.
So If B18 equals Blue and B20 equals Red then B23 equals 1234 but if B18 equals Blue and B20 equals Yellow them B23 equals 5678, but if B18 equals Pink and B20 equals Yellow then B23 equals 9876
Hopefully that's also possible and again appreciate your help
- Martin_AngostoSep 09, 2024Iron Contributor
Glad it initially worked!
For this second purpose, you can use:
=IF(AND(B18 = "Blue", B20 = "Red"), 1234, IF(AND(B18 = "Blue", B20 = "Yellow"), 5678, IF(AND(B18 = "Pink", B20 = "Yellow"), 9876, "")))
Note that in the event that none of the two scenarios/combinations exist, the formulation would just leave cell B23 blank.