Forum Discussion

JerryGraz's avatar
JerryGraz
Copper Contributor
May 10, 2025
Solved

IFS does not return correct results

I am using the following formula:
=IFS(F7>=$R$1,33,F7>$S$1,35,F7="",0)

The formula is returning the first condition and the last condition but not the second condition.  FYI, F7 contains a date (and the cell is formatted as a date); R1 also contains a date, S1 contains a different date.  This is the condition that is not returning the correct true result.

Basically, I want a particular value to be provided if the date in f7 is greater than R1.  If F7 is greater than the value in S1, then I want a different value returned.

Help please... this has been driving me crazy for a couple of hours!!!

  • Hard to say without knowing what the cells contain.

    Does this do what you want?

    =IFS(F7>=$S$1,35,F7>$R$1,33,F7="",0)

4 Replies

  • JerryGraz's avatar
    JerryGraz
    Copper Contributor

    Thanks Sergei and Hans as both of these formulas provide the results I have been looking for!

  • MKoski's avatar
    MKoski
    Copper Contributor

    It may need more conditions... 

    • When the date in "R" is less then the date...in "F" and the date in "S" is greater then "F" it returns "33"
    • When the date in "R" is greater then the date...in "F" and the date in "S" is less then "F" it returns "35"
    • I get "N/A" if the both the dates in "R" and "S" are greater then "F"
    • I get "33" if the both the dates in "R" and "S" are less then "F"
  • As variant and with some assumption about your data

    =(33+2*(F7>MAX($R$1:$S$1)) )*(F7<>"")
  • Hard to say without knowing what the cells contain.

    Does this do what you want?

    =IFS(F7>=$S$1,35,F7>$R$1,33,F7="",0)

Resources

OSZAR »