Forum Discussion
Gunnie
May 15, 2024Copper Contributor
Problem with an if formula
Trying to write an If formula. If cell A1 has A then formula A runs is cell C1. If Cell A1 has B then formula B runs in cell C1. This is what I tried but get an
=IF(A1="UG",(IF(ISBLANK(B1),"",EDATE(B1,6)),("")),IF(A1="PS",(IF(ISBLANK(B1),"",EDATE(B1,8)),("")))
Does this work?
=IF(A1="UG",(IF(ISBLANK(B1),"",EDATE(B1,6))),IF(A1="PS",(IF(ISBLANK(B1),"",EDATE(B1,8)))))
- Riny_van_EekelenPlatinum Contributor
Gunnie You have an answer already.
Even in the Answers forum:
Issues with an IF formula: IF A1 = A run formula A IF A1 = B then run - Microsoft Community
Although cross-posting without mentioning it is not good practice, I offer you another solution.
=IF(ISBLANK(B2),"",EDATE(B2,SWITCH(A2,"UG",6,"PS",8)))
- Martin_AngostoIron Contributor
Does this work?
=IF(A1="UG",(IF(ISBLANK(B1),"",EDATE(B1,6))),IF(A1="PS",(IF(ISBLANK(B1),"",EDATE(B1,8)))))
- GunnieCopper Contributor
- Martin_AngostoIron Contributor
So glad it worked! Gunnie