0

I'm trying to configure a volume discount system in a cell. I want to say:

If qty is 1, cost is $49.99; if qty is 2-3, cost is $49.50; if qty is 4+, cost is $48.99.

The furthest I've gotten is:

=OR((IF(I7<2,49.99)),(IF(OR(I7>1,I7<4),49.5)))  

in which I7 is the cell containing qty. This returns TRUE which I understand is how the OR function works.

I'm just at a loss to how I can incorporate multiple outputs into a single cell given multiple potential conditions.

pnuts
  • 58,317
  • 11
  • 87
  • 139
Willman
  • 438
  • 3
  • 6
  • 12

2 Answers2

5

You can omit OR and simply chain multiple IFs:

=IF(I7<=0, 0, IF(I7=1, 49.99, IF(I7<4, 49.5, 48.99)))

In pseudo-code, this reads:

If      I7 <= 0, then return  0.00
else If I7 =  1, then return 49.99
else If I7 <  4, then return 49.50
else                  return 48.99
Rick Hitchcock
  • 35,202
  • 5
  • 48
  • 79
1

A conventional alternative to nested IFs is to use a sorted lookup_array for breakpoints only and apply VLOOKUP with the inexact match option. Say you have a range (if of Workbook Scope, anywhere in the workbook) named table_array:

| 1 | 49.99 |  
| 2 | 49.5  |  
| 4 | 48.99 |

and E1 contains the quantity:

=VLOOKUP(E1,table_array,2,1) 
pnuts
  • 58,317
  • 11
  • 87
  • 139
  • 1
    I actually thought about using `VLOOKUP` but my data wasn't sorted. I didn't think about having a separate table of values off to the side though. Thanks for the extra input! – Willman Sep 25 '15 at 12:22