SOLVED

Help with IF Conditional formatting

Copper Contributor

Hi I am not an excel expert so pardon if my question sounds confusing. I am trying to set multiple conditions using free text as validation and want to build a formula to calculate. Here is what I did. 

 

=IF(AND(M11>="RfR"),"=(D5+60)",IF(AND(M11>="PSJO"),"=(D5+120)",IF(AND(M11="TJO"),"=(D5+45)", " ")))

Result I got as per data in column M is as follows: 

=(D5+60) 

=(D5+120) 

=(D5+45)

However, what I want is for excel to calculate the date by adding 60 or 120 or 45 to the date in column D, instead of showing the formula. Please advise where I am going wrong. Column D contains Dates for e.g: 10/16/2022 and Column M contains text from drop down list, e.g RfR or PSJO or TJO 

2 Replies
best response confirmed by Hans Vogelaar (MVP)
Solution

@curiouslearner70 

Keeping the same logic as what you stated with, try this:

=IF(M11>="TJO",D5+45,IF(M11>="RfR",D5+60,IF(M11>="PJSO",D5+120, "")))

 

No need for the AND bits and you need the check the texts in descending alphabetical order.

 

Edit: And no need for the quotation marks and the = sign where you want to perform a calculation as it just creates a text like =D5+60 as you discovered.

Hi @Riny_van_Eekelen, thanks for the swift and BRILLIANT response! Yes, Yes, Yes! It worked! Ha! We live and learn from each other! This was my first experience reaching out on a forum like this with a question and my experience has been SUPER! Many thanks again!!!
1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

@curiouslearner70 

Keeping the same logic as what you stated with, try this:

=IF(M11>="TJO",D5+45,IF(M11>="RfR",D5+60,IF(M11>="PJSO",D5+120, "")))

 

No need for the AND bits and you need the check the texts in descending alphabetical order.

 

Edit: And no need for the quotation marks and the = sign where you want to perform a calculation as it just creates a text like =D5+60 as you discovered.

View solution in original post