Forum Discussion

Mel_from_the_Territory's avatar
Mel_from_the_Territory
Copper Contributor
Aug 12, 2021
Solved

IF Statement Pain Scores

HI All - I am trying to write an IF Statement for the following   I have two columns of numbers (very long columns). The first list is numbers from 7-10 (A2) , the second list is numbers from 0-10...
  • Riny_van_Eekelen's avatar
    Aug 12, 2021

    Mel_from_the_Territory First of all, your "numbers" are in fact texts (except for cell B2, that seems to contain the real number 10) and it's difficult to calculate with texts.

     

    Start by selecting column B. On the Data ribbon, select Text-to-columns and press Finish. Repeat for column C. That should have transformed the texts to numbers and the small green triangles should be gone now.

     

    With regard to the formula needed for the highlights in the screenshot you could use conditional formatting with a rule (based on a formula) like: =C2>=B2-2, applied to the range starting in C2 all the way down.

     

    Or, if you prefer a formula in a separate column you could enter =IF(C2>= B2-2, "x","") in an empty column on row 2 and copy it all the way down. An x would mark the rows that meet the criteria.