Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default If then statement

I would like to set up an if then statement incorporating the language below:

If AK11 is <= 243.9 then it is grade M01
If AK11 is =244 but less than 313 then M02
If AK11 is =313 but less than 382 then M03
If AK11 is =382 but less than 451 then M04
If AK11 is =451 but less than 520 then M05

Is this possible. Pls advise.

EggHeadCafe - Software Developer Portal of Choice
XCeed Streaming Compression Library
http://www.eggheadcafe.com/tutorials...compressi.aspx
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default If then statement

Anna McKenzie wrote:
I would like to set up an if then statement incorporating the language below:

If AK11 is <= 243.9 then it is grade M01
If AK11 is =244 but less than 313 then M02
If AK11 is =313 but less than 382 then M03
If AK11 is =382 but less than 451 then M04
If AK11 is =451 but less than 520 then M05

Is this possible. Pls advise.

EggHeadCafe - Software Developer Portal of Choice
XCeed Streaming Compression Library
http://www.eggheadcafe.com/tutorials...compressi.aspx



=LOOKUP(AK11,{0,243.9,313,382,451,520},{"M01","M02 ","M03","M04","M05","Undefined"})
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default If then statement

Glenn wrote:
Anna McKenzie wrote:
I would like to set up an if then statement incorporating the language
below:

If AK11 is <= 243.9 then it is grade M01
If AK11 is =244 but less than 313 then M02
If AK11 is =313 but less than 382 then M03
If AK11 is =382 but less than 451 then M04
If AK11 is =451 but less than 520 then M05

Is this possible. Pls advise.

EggHeadCafe - Software Developer Portal of Choice XCeed Streaming
Compression Library
http://www.eggheadcafe.com/tutorials...compressi.aspx



=LOOKUP(AK11,{0,243.9,313,382,451,520},{"M01","M02 ","M03","M04","M05","Undefined"})

Actually, you will want either 243.9000000001 or 244 in place of 243.9 in the
formula above, depending upon the number of decimal places in your data.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default If then statement

You could nest ifs, but it would probably be more efficient (and
easier to debug) if you used something like a vlookup instead.


On Nov 10, 10:53*am, Anna McKenzie wrote:
I would like to set up an if then statement incorporating the language below:

If AK11 is <= 243.9 then it is grade M01
If AK11 is =244 but less than 313 then M02
If AK11 is =313 but less than 382 then M03
If AK11 is =382 but less than 451 then M04
If AK11 is =451 but less than 520 then M05

Is this possible. *Pls advise.

EggHeadCafe - Software Developer Portal of Choice
XCeed Streaming Compression Libraryhttp://www.eggheadcafe.com/tutorials/aspnet/43d6dcbd-c079-4707-8def-7...


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default If then statement

Set up a two-column table somewhere (eg AX1:AY6) as follows:

0 M01
244 M02
313 M03
382 M04
451 M05
520 Too large

Then you can use this formula:

=VLOOKUP(AK11,AX$1:AY$6,2)

Copy it down if required.

Hope this helps.

Pete

On Nov 10, 3:53*pm, Anna McKenzie wrote:
I would like to set up an if then statement incorporating the language below:

If AK11 is <= 243.9 then it is grade M01
If AK11 is =244 but less than 313 then M02
If AK11 is =313 but less than 382 then M03
If AK11 is =382 but less than 451 then M04
If AK11 is =451 but less than 520 then M05

Is this possible. *Pls advise.

EggHeadCafe - Software Developer Portal of Choice
XCeed Streaming Compression Libraryhttp://www.eggheadcafe.com/tutorials/aspnet/43d6dcbd-c079-4707-8def-7...




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 140
Default If then statement

Col A Col B
0 M01
243.8 M01
243.9 M02
312 M02
313 M03
381 M03
382 M04
450 M04
451 M05
520 M05

In Cell D1 type =Lookup(C1,A1:B10)
The table acts as ranges for your M0 numbers. The lookup find the actual that
you input into C1 say 427, and the corresponding M0 number is retruned, in
this case it would be M04


Thanks
Matt



Anna McKenzie wrote:
I would like to set up an if then statement incorporating the language below:

If AK11 is <= 243.9 then it is grade M01
If AK11 is =244 but less than 313 then M02
If AK11 is =313 but less than 382 then M03
If AK11 is =382 but less than 451 then M04
If AK11 is =451 but less than 520 then M05

Is this possible. Pls advise.

EggHeadCafe - Software Developer Portal of Choice
XCeed Streaming Compression Library
http://www.eggheadcafe.com/tutorials...compressi.aspx


--
Matt Lynn

Message posted via http://www.officekb.com

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
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
Embedding an OR statement in an IF statement efficiently Chatnoir11 Excel Discussion (Misc queries) 4 February 2nd 09 08:12 PM
Sum if statement with a left statement Eric D Excel Discussion (Misc queries) 4 July 23rd 08 05:31 PM
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM


All times are GMT +1. The time now is 10:20 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"