Forum Discussion

TRM353's avatar
TRM353
Copper Contributor
Aug 03, 2022

Excel

what's wrong with this formula?: =IF(D157>=5,"5","D157") I want column E to contain number in Column D if less than or = to 5, if greater than 5 then "5"

 

Thank you!

6 Replies

  • TRM353 

    "D157" is a literal text string, not a cell reference.

    Use

     

    =IF(D157>=5, 5, D157)

     

    or shorter

     

    =MIN(D157, 5)

    • TRM353's avatar
      TRM353
      Copper Contributor

      HansVogelaar 

       

      You are a genius! Thank you very much.

       

      Could I add additional parameters? For example if I wanted to ignore any figures in column D that were less than 1.0 could I add: <1.0,0,

Resources