Forum Discussion

curiouslearner70's avatar
curiouslearner70
Copper Contributor
Nov 20, 2022
Solved

Help with IF Conditional formatting

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 

  • 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.

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    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.

    • curiouslearner70's avatar
      curiouslearner70
      Copper Contributor
      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!!!

Resources