Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Laz Laz is offline
external usenet poster
 
Posts: 1
Default IF statement - multiple scenarios

I'm sure this will be simple to many of you but I really need to know how to
formulate this into one statement, Any help is greatly appreciated.

IF A1 0 but < 13, 1
IF A1 < 0 but -13, -1
IF A1 12 but < 25, 2
IF A1 < -12 but -25, -2
IF A1 24, 3
IF A1 < -24, -3

You can also email me at
Thanks a lot.
Larry (Laz)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JNW JNW is offline
external usenet poster
 
Posts: 480
Default IF statement - multiple scenarios

=if(and(a10,a1<13),1,if(and(a1<0,a1-13),-1,if(and(a112,a1<25),2,if(and(a1<-12,a1-25),-2,if(a124,3,if(a1<-24,-3,0))))))

This assumes that if a1 is 0 then the result is 0 also.
--
JNW


"Laz" wrote:

I'm sure this will be simple to many of you but I really need to know how to
formulate this into one statement, Any help is greatly appreciated.

IF A1 0 but < 13, 1
IF A1 < 0 but -13, -1
IF A1 12 but < 25, 2
IF A1 < -12 but -25, -2
IF A1 24, 3
IF A1 < -24, -3

You can also email me at
Thanks a lot.
Larry (Laz)

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,480
Default IF statement - multiple scenarios

Hi

One way
=SIGN(A1)*IF(ABS(A1)<13,1,IF(ABS(A1)<25,2,3))

--
Regards
Roger Govier



"Laz" wrote in message
...
I'm sure this will be simple to many of you but I really need to know how
to
formulate this into one statement, Any help is greatly appreciated.

IF A1 0 but < 13, 1
IF A1 < 0 but -13, -1
IF A1 12 but < 25, 2
IF A1 < -12 but -25, -2
IF A1 24, 3
IF A1 < -24, -3

You can also email me at
Thanks a lot.
Larry (Laz)



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JNW JNW is offline
external usenet poster
 
Posts: 480
Default IF statement - multiple scenarios

Much more concise than mine! I didn't know about the sign function. Thanks.
--
JNW


"Roger Govier" wrote:

Hi

One way
=SIGN(A1)*IF(ABS(A1)<13,1,IF(ABS(A1)<25,2,3))

--
Regards
Roger Govier



"Laz" wrote in message
...
I'm sure this will be simple to many of you but I really need to know how
to
formulate this into one statement, Any help is greatly appreciated.

IF A1 0 but < 13, 1
IF A1 < 0 but -13, -1
IF A1 12 but < 25, 2
IF A1 < -12 but -25, -2
IF A1 24, 3
IF A1 < -24, -3

You can also email me at
Thanks a lot.
Larry (Laz)




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default IF statement - multiple scenarios

If the values will always fall within a range of -37<=value<=37, then we can
get even more concise...

=SIGN(A1)+FLOOR(A1/12.5,SIGN(A1))

If the values can fall outside of that range, we can still come in with a
formula that is 2 characters more concise...

=SIGN(A1)*(1+FLOOR(MIN(ABS(A1),36)/12.5,1))

Rick


"JNW" wrote in message
...
Much more concise than mine! I didn't know about the sign function.
Thanks.
--
JNW


"Roger Govier" wrote:

Hi

One way
=SIGN(A1)*IF(ABS(A1)<13,1,IF(ABS(A1)<25,2,3))

--
Regards
Roger Govier



"Laz" wrote in message
...
I'm sure this will be simple to many of you but I really need to know
how
to
formulate this into one statement, Any help is greatly appreciated.

IF A1 0 but < 13, 1
IF A1 < 0 but -13, -1
IF A1 12 but < 25, 2
IF A1 < -12 but -25, -2
IF A1 24, 3
IF A1 < -24, -3

You can also email me at
Thanks a lot.
Larry (Laz)





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF statement with multiple scenarios. AMS Excel Discussion (Misc queries) 3 May 21st 07 09:47 PM
How to do if/then formula with multiple scenarios. JudyK Excel Discussion (Misc queries) 1 October 16th 06 05:39 PM
consolidating results of multiple scenarios sloth Excel Discussion (Misc queries) 0 September 24th 06 10:45 PM
Return multiple scenarios Casey D Excel Worksheet Functions 3 March 7th 06 09:45 PM
Multiple vendors and scenarios - Excel Vincent Kelly via OfficeKB.com Excel Worksheet Functions 1 March 2nd 05 04:47 AM


All times are GMT +1. The time now is 07:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"