ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   conditional formula: return 1 of 4 values (https://www.excelbanter.com/excel-worksheet-functions/65284-conditional-formula-return-1-4-values.html)

Pladdy

conditional formula: return 1 of 4 values
 
How can i use a conditional formula to return one of 4 values,
if C:13 is less than 274 should be 8,
if C:13 is less than 329 should be 16,
if C:13 is more than 329 should be 24,
if C:13 is more than 438 should be 32.

I know I'm close tough not quite

=(C13<274)*8 + (C13274=16)*(C13<329=24)*24 + (C13438)*32

Anne Troy

conditional formula: return 1 of 4 values
 
=if(c13<274,c13*8,if(c13<329,c13*16,if(c13<438,c13 *24,if(c13=438,c13*32,c13))))

Excel will continue until it finds a true.
The above says if it's less than 274, multiply it by 8. If it is not less
than 274, it will continue to the next argument. If you really need "less
than or equal to 274", then put C13<=274 as the first argument. You may also
need to consider what you want to do if it is zero or less than zero..

************
Hope it helps!
Anne Troy
www.OfficeArticles.com

"Pladdy" wrote in message
...
How can i use a conditional formula to return one of 4 values,
if C:13 is less than 274 should be 8,
if C:13 is less than 329 should be 16,
if C:13 is more than 329 should be 24,
if C:13 is more than 438 should be 32.

I know I'm close tough not quite

=(C13<274)*8 + (C13274=16)*(C13<329=24)*24 + (C13438)*32




Peo Sjoblom

conditional formula: return 1 of 4 values
 
Your criteria does not handle if a value is equal to so I had to guess

=LOOKUP(C13,{0;274;329;438},{8;16;24;32})

adapt to fit

--
Regards,

Peo Sjoblom

Portland, Oregon




"Pladdy" wrote in message
...
How can i use a conditional formula to return one of 4 values,
if C:13 is less than 274 should be 8,
if C:13 is less than 329 should be 16,
if C:13 is more than 329 should be 24,
if C:13 is more than 438 should be 32.

I know I'm close tough not quite

=(C13<274)*8 + (C13274=16)*(C13<329=24)*24 + (C13438)*32



Pladdy

conditional formula: return 1 of 4 values
 
You're the hero, many thanks......

"Peo Sjoblom" wrote:

Your criteria does not handle if a value is equal to so I had to guess

=LOOKUP(C13,{0;274;329;438},{8;16;24;32})

adapt to fit

--
Regards,

Peo Sjoblom

Portland, Oregon




"Pladdy" wrote in message
...
How can i use a conditional formula to return one of 4 values,
if C:13 is less than 274 should be 8,
if C:13 is less than 329 should be 16,
if C:13 is more than 329 should be 24,
if C:13 is more than 438 should be 32.

I know I'm close tough not quite

=(C13<274)*8 + (C13274=16)*(C13<329=24)*24 + (C13438)*32





All times are GMT +1. The time now is 04:53 AM.

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