ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   The IF function but with 3 values (https://www.excelbanter.com/excel-worksheet-functions/129458-if-function-but-3-values.html)

[email protected]

The IF function but with 3 values
 
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


Dave F

The IF function but with 3 values
 
=IF(L7<2,3.5,IF(L7=2,3.2,2.8))

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


" wrote:

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



Mike

The IF function but with 3 values
 
=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?

" wrote:

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



Don Guillett

The IF function but with 3 values
 
try
=if(l7=3,2.8,if(l7=2,3.20,if(l70,3.50,"")))

--
Don Guillett
SalesAid Software

wrote in message
oups.com...
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




Lori

The IF function but with 3 values
 
=LOOKUP(L7,{0,3.5;2,3.2;3,2.8})

On Feb 6, 2:19 pm, wrote:
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




JE McGimpsey

The IF function but with 3 values
 
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})


In article .com,
wrote:

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


JE McGimpsey

The IF function but with 3 values
 
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.

In article ,
Mike wrote:

=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?



All times are GMT +1. The time now is 09:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com