Google-sheets – Google-sheet IF function not working

formulasgoogle sheets

I need a formula in Google spreadsheet that will:

  • +1 when the value is >=5,
  • +2 when the value is >=10,
  • +3 when the value is >=15,
  • +4 when the value is >=20,
  • +5 when the value is >=25

The formula I am currently using is:

=IF(F7>=5,H7+1,IF(F7>=10,H7+2,IF(F7>=15,H7+3,IF(F7>=20,H7+4,H7))))

This formula is working for the +1 when the value is >=5, but when the value is >=10,15,20,or 25 it is still only adding +1.

Please Help!

Best Answer

If the first condition is F7>=5 then the result will always be +1 wether F7 = 5, 15, or even 200.
It's because the first condition F7>=5 is always met.

Try this instead :

=IF(
   F7>=25,H7+5,
              IF(
               F7>=20,H7+4,
                           IF(
                            F7>=15,H7+3,
                                       IF(
                                          F7>=10,H7+2,
                                                      IF(F7>=5,H7+1,H7)
                                          )
                               )
                  )
       )