Home > database >  Multiple if conditions with 'more than' and 'less than' values
Multiple if conditions with 'more than' and 'less than' values

Time:03-22

How do we write these statements and their respective values below using the IF() conditions?

  • If 0 to equal or less than 8, $0.00
  • If 9 to equal or less than 18, $10.00
  • If 19 to equal or less than - 37, $20.00
  • If 38 to equal or less than - 51, $30.00
  • If equal to or more than 53, $60.00

I can't wrap my head around it after a couple of days of trials. Hope someone can clear this up for me.

CodePudding user response:

@player0's answer is the answer I personally would use.

If you must use IF-conditions, then the following might be useful:

=IF(ISBETWEEN(A1;0;8);0;IF(ISBETWEEN(A1;9;18);10;IF(ISBETWEEN(A1;19;37);20;IF(ISBETWEEN(A1;38;52);30;IF(A1>=53;60;0)))))

CodePudding user response:

use:

=VLOOKUP(A1, {0, 0; 9, 10; 19, 20; 38, 30; 53, 60}, 2, 1)

see: https://webapps.stackexchange.com/q/123729/186471

  • Related