Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 3
Default If value between 2 numbers

I am working on an inventory spreadsheet. The formula I need help with is IF("VLOOKUP VALUE") is between 1-19 then "LOW"; IF "VALUE" between 20-49 then "MEDIUM"; IF "VALUE" between 50-74 then "HIGH"; IF "VALUE" = 75 then "HEAVY".

I hope that makes sense. Thanks.
  #2   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by CMoHorn View Post
I am working on an inventory spreadsheet. The formula I need help with is IF("VLOOKUP VALUE") is between 1-19 then "LOW"; IF "VALUE" between 20-49 then "MEDIUM"; IF "VALUE" between 50-74 then "HIGH"; IF "VALUE" = 75 then "HEAVY".

I hope that makes sense. Thanks.
Would the VLOOKUP values always be whole numbers or could they be decimals too?

If always whole numbers then a simple VLOOKUP table would work.

If decimals then a long winded IF AND nested formula would be needed.
  #3   Report Post  
Junior Member
 
Posts: 3
Default

Quote:
Originally Posted by Spencer101 View Post
Would the VLOOKUP values always be whole numbers or could they be decimals too?

If always whole numbers then a simple VLOOKUP table would work.

If decimals then a long winded IF AND nested formula would be needed.
Spencer, thanks for the reply. The value would always be a whole number. I'm not exactly sure how to use the VLOOKUP table in the formula above though.
  #4   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by CMoHorn View Post
Spencer, thanks for the reply. The value would always be a whole number. I'm not exactly sure how to use the VLOOKUP table in the formula above though.
I'm replying from an ipad with no access to Excel so this is off the top of my head and possibly a little vague....

You nest your current VLOOKUP inside another one. So where a VLOOKUP starts =vlookup(a1,range... Etc, you replace the A1 with your current VLOOKUP.

Does that make sense?

You can either use ,false) at the end meaning you'd need a lookup table with each possible value or a ,true) at the end meaning you'd only have to have one entry for each low, med high etc.

If you can post an example workbook here or email it to me at pubnut @ gmail . com I will show you what I mean as soon as I get home to my pc.

Last edited by Spencer101 : December 10th 12 at 04:34 PM
  #5   Report Post  
Junior Member
 
Posts: 3
Default

Quote:
Originally Posted by Spencer101 View Post
I'm replying from an ipad with no access to Excel so this is off the top of my head and possibly a little vague....

You nest your current VLOOKUP inside another one. So where a VLOOKUP starts =vlookup(a1,range... Etc, you replace the A1 with your current VLOOKUP.

Does that make sense?

You can either use ,false) at the end meaning you'd need a lookup table with each possible value or a ,true) at the end meaning you'd only have to have one entry for each low, med high etc.

If you can post an example workbook here or email it to me at pubnut @ gmail . com I will show you what I mean as soon as I get home to my pc.
That may be a little beyond my excel ability, but I'll play around with it. I'll aslo send you an email with an example workbook. Thanks!


  #6   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by CMoHorn View Post
That may be a little beyond my excel ability, but I'll play around with it. I'll aslo send you an email with an example workbook. Thanks!
Not a problem. I'll be in front of a pc in about half an hour.
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default If value between 2 numbers

On Monday, December 10, 2012 8:03:37 AM UTC-8, CMoHorn wrote:
I am working on an inventory spreadsheet. The formula I need help with

is IF("VLOOKUP VALUE") is between 1-19 then "LOW"; IF "VALUE" between

20-49 then "MEDIUM"; IF "VALUE" between 50-74 then "HIGH"; IF "VALUE" =

75 then "HEAVY".



I hope that makes sense. Thanks.









--

CMoHorn


Hi CMoHorn,

See if this works for you.
Where your lookup value is in C1.

=LOOKUP(C1,{1,20,50,75},{"Low","Med","High","Heavy "})

HTH
Regards,
Howard

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default If value between 2 numbers

CMoHorn has brought this to us :
I am working on an inventory spreadsheet. The formula I need help with
is IF("VLOOKUP VALUE") is between 1-19 then "LOW"; IF "VALUE" between
20-49 then "MEDIUM"; IF "VALUE" between 50-74 then "HIGH"; IF "VALUE" =
75 then "HEAVY".

I hope that makes sense. Thanks.


Assuming "VLOOKUP VALUE" is the result of a formula in A1, try...


=IF(AND($A10,$A1<20),"LOW",IF(AND($A119,$A1<50), "MEDIUM",IF(AND($A149,$A1<75),"HIGH",IF($A174,"H EAVY",""))))

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default If value between 2 numbers

on 10/12/2012, supposed :
=LOOKUP(C1,{1,20,50,75},{"Low","Med","High","Heavy "})


Howard,
Exactly what I would do in a real project because it's more efficient
(and self-explanatory to me). I chose to follow the OP's logic
combining IF/AND functions for learning benefit (hopefully).<g

--
Garry

Free usenet access at
http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default If value between 2 numbers

Actually, my above statement is not entirely true. I like a clean
worksheet and so try to avoid looking at errors returned by formulas.
My first offering accomplishes this if the lookup value is outside the
criteria range[s]. The way I'd use LOOKUP normally would to wrap it in
an IF function so it returns an empty string on error...


=IF(ISERROR(LOOKUP($A1,{1,20,50,75},{"low","med"," high","heavy"})),"",LOOKUP($A1,{1,20,50,75},{"low" ,"med","high","heavy"}))

...and so we lose formula brevity. I this OP's scenario, outside the
range is any value <1. IMO, it's better to *not* have errors propagate
to other cells containing formulas that ref cells with formulas that
return errors!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 168
Default If value between 2 numbers

On Monday, December 10, 2012 12:06:45 PM UTC-8, GS wrote:
on 10/12/2012, supposed :

=LOOKUP(C1,{1,20,50,75},{"Low","Med","High","Heavy "})




Howard,

Exactly what I would do in a real project because it's more efficient

(and self-explanatory to me). I chose to follow the OP's logic

combining IF/AND functions for learning benefit (hopefully).<g



--

Garry



Free usenet access at
http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion


Hi Gary,

"...combining IF/AND functions for learning benefit (hopefully).<g "

When it comes to that many IF/AND's (and let's not forget OR) I struggle. I should take your gentle advise and become more adept with them, but it is way to easy go the LOOKUP route.

Howard

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,514
Default If value between 2 numbers

brought next idea :
On Monday, December 10, 2012 12:06:45 PM UTC-8, GS wrote:
on 10/12/2012,
supposed :

=LOOKUP(C1,{1,20,50,75},{"Low","Med","High","Heavy "})




Howard,

Exactly what I would do in a real project because it's more efficient

(and self-explanatory to me). I chose to follow the OP's logic

combining IF/AND functions for learning benefit (hopefully).<g



--

Garry



Free usenet access at
http://www.eternal-september.org

Classic VB Users Regroup!

comp.lang.basic.visual.misc

microsoft.public.vb.general.discussion


Hi Gary,

"...combining IF/AND functions for learning benefit (hopefully).<g "

When it comes to that many IF/AND's (and let's not forget OR) I struggle. I
should take your gentle advise and become more adept with them, but it is way
to easy go the LOOKUP route.

Howard


I agree, and as I said to Howard it's how I would do it, just for the
simplicity. Did you note my 2nd version to address errors if the lookup
value cell is empty OR contains a value <1?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,045
Default If value between 2 numbers

On Mon, 10 Dec 2012 16:03:37 +0000, CMoHorn wrote:


I am working on an inventory spreadsheet. The formula I need help with
is IF("VLOOKUP VALUE") is between 1-19 then "LOW"; IF "VALUE" between
20-49 then "MEDIUM"; IF "VALUE" between 50-74 then "HIGH"; IF "VALUE" =
75 then "HEAVY".

I hope that makes sense. Thanks.


And here is another that assumes VALUE will always be an integer, and that you have not defined what you want returned if VALUE is not a number =1:

=IF(OR(A1<1,NOT(ISNUMBER(A1))),"undefined",IF(A1<2 0,"LOW",IF(A1<50,"MEDIUM",IF(A1<75,"HIGH","HEAVY") )))

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
Need to reconcile numbers accounting Harlan Grove code doesn't work for negative numbers [email protected] Excel Programming 1 July 28th 06 07:09 AM
Excel Formula - Add column of numbers but ignore negative numbers view for Distribution List members Excel Worksheet Functions 1 April 7th 06 03:13 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 3 January 19th 06 09:52 AM
Help! How do you get excel to find the x(changes daily, marked in a cell from another formula) highest numbers in a group of numbers and sum them up? C-Man23 Excel Worksheet Functions 1 January 9th 06 01:23 PM


All times are GMT +1. The time now is 03:36 AM.

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"