ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If then with wrong return value (https://www.excelbanter.com/excel-worksheet-functions/181030-if-then-wrong-return-value.html)

Clark

If then with wrong return value
 
This If-Then will only return "0" or "3.4" depending upon the contents of H8.
How do I modify it to give me the number I want based upon the contents of
H8?

=IF(H8<=10,3.4,IF(H8=10<=20,2.7,IF(H820<=30,2.3, IF(H830<=40,2,IF(H840<=80,1.8,IF(H880,1.5,))))) )

Sandy Mann

If then with wrong return value
 
Try:

=IF(H880,1.5,IF(H840,1.8,IF(H830,2,IF(H820,2.3 ,IF(H810,2.7,3.4)))))

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Clark" wrote in message
...
This If-Then will only return "0" or "3.4" depending upon the contents of
H8.
How do I modify it to give me the number I want based upon the contents of
H8?

=IF(H8<=10,3.4,IF(H8=10<=20,2.7,IF(H820<=30,2.3, IF(H830<=40,2,IF(H840<=80,1.8,IF(H880,1.5,))))) )




David Biddulph[_2_]

If then with wrong return value
 
=IF(H8<=10,3.4,IF(H8<=20,2.7,IF(H8<=30,2.3,IF(H8<= 40,2,IF(H8<=80,1.8,1.5)))))
--
David Biddulph

"Clark" wrote in message
...
This If-Then will only return "0" or "3.4" depending upon the contents of
H8.
How do I modify it to give me the number I want based upon the contents of
H8?

=IF(H8<=10,3.4,IF(H8=10<=20,2.7,IF(H820<=30,2.3, IF(H830<=40,2,IF(H840<=80,1.8,IF(H880,1.5,))))) )




Tyro[_2_]

If then with wrong return value
 
If the number in H8 is never negative then:
=IF(H8<=10,3.4,IF(H8<=20,2.7,IF(H8<=30,2.3,IF(H8<= 40,2,IF(H8<=80,1.8,1.5)))))
You cannot use H8=10<=20 This has to be expressed as AND(H8=10,H8<=20)
There are other formulas to do this too, but I wanted to show you with IF's,
the way you're trying to do it.

Tyro

"Clark" wrote in message
...
This If-Then will only return "0" or "3.4" depending upon the contents of
H8.
How do I modify it to give me the number I want based upon the contents of
H8?

=IF(H8<=10,3.4,IF(H8=10<=20,2.7,IF(H820<=30,2.3, IF(H830<=40,2,IF(H840<=80,1.8,IF(H880,1.5,))))) )




Tyro[_2_]

If then with wrong return value
 
The formula will return 3.4 for negative numbers.

Tyro

"Tyro" wrote in message
...
If the number in H8 is never negative then:
=IF(H8<=10,3.4,IF(H8<=20,2.7,IF(H8<=30,2.3,IF(H8<= 40,2,IF(H8<=80,1.8,1.5)))))
You cannot use H8=10<=20 This has to be expressed as AND(H8=10,H8<=20)
There are other formulas to do this too, but I wanted to show you with
IF's, the way you're trying to do it.

Tyro

"Clark" wrote in message
...
This If-Then will only return "0" or "3.4" depending upon the contents of
H8.
How do I modify it to give me the number I want based upon the contents
of
H8?

=IF(H8<=10,3.4,IF(H8=10<=20,2.7,IF(H820<=30,2.3, IF(H830<=40,2,IF(H840<=80,1.8,IF(H880,1.5,))))) )






T. Valko

If then with wrong return value
 
Another one...

Assuming the value of H8 is *always* a positive number:

=LOOKUP(H8,{0,11,21,31,41,81},{3.4,2.7,2.3,2,1.8,1 .5})

If H8 is empty the formula will return 3.4.

To prevent that:

=IF(COUNT(H8),LOOKUP(H8,{0,11,21,31,41,81},{3.4,2. 7,2.3,2,1.8,1.5}),"")


--
Biff
Microsoft Excel MVP


"Clark" wrote in message
...
This If-Then will only return "0" or "3.4" depending upon the contents of
H8.
How do I modify it to give me the number I want based upon the contents of
H8?

=IF(H8<=10,3.4,IF(H8=10<=20,2.7,IF(H820<=30,2.3, IF(H830<=40,2,IF(H840<=80,1.8,IF(H880,1.5,))))) )





All times are GMT +1. The time now is 06:03 PM.

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