The IF function but with 3 values

J

jim

Hi

I have a cell that generates an age in years from a date of birth in
another cell. 1, 2, 3 etc,

The age is displayed in L7

In another cell I need one of three prices based upon that age in
L7

Under age 2 should return a price of 3.50
Aged 2 should return a price of 3.20
And 3 and above should returna price of 2.8

I have tried playing with the IF function but just cannot get it to
work

Hope you can help. Thanks in anticipation
 
G

Guest

=IF(I7<2,"3.5",IF(I7=2,3.2,IF(I7>=3,2.8)))

The above will give the answer you want but are you sure your logic is
correct. What happens between 2 and 3?
 
J

JE McGimpsey

one way:

=IF(L7<2, 3.5, IF(L7<3, 3.2, 2.8)

another:

=LOOKUP(L7, {0, 2, 3}, {3.5, 3.2, 2.8})
 
J

JE McGimpsey

Assuming the OP wanted numbers rather than text, the 3.5 should not be
in quotes. If the OP wanted text instead, the other values should be in
quotes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top