Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Multiple IF Statements

Hi,

I understand the basics of Excel coding, however a shorter method for
my task has stumped me.
I need to create a worksheet where I can do the following:

Let's say we have 3001 people in line.

If there are 3000(+) people behind a guy, he gets 3 apples.
If there are 2000+ (but less than 3000) people behind a guy, he gets 2
apples.
etc. and so on.
The important values would be:
#people 3000 2500 2000 1500 1000 750 500 300
#apples 3 2.5 2 1.5 1 0.9 0.8 0.7

#people 200 100 50 10
#apples 0.6 0.5 0.25 0.1

I would have to set ranges for the values. ie. If you had 751 people
behind you, you would still get 0.9 apples.

I understand that Nested IF statements only go up to 7 values. I also
tried using
=VLOOKUP(Target!A2,List!$A$2:$B$14,2,FALSE)
Where the target had the actual position of a person in line, and List
had values for the # of people and # of apples given in Ax and Bx
respectively. However that only allowed me to find exact values, not
ranges, which i need.

The ratios and # of people in behind a person would be preferrably
easily adjusted, to see the effects of a change in value.

I was wondering if anyone had a solution to my problem?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 80
Default Multiple IF Statements

If you change the FALSE in your formula to TRUE, between 750 and 999 people
will give you 0.9, and 1000 to 1499 will give you 1.
--
Hth

Kassie Kasselman


" wrote:

Hi,

I understand the basics of Excel coding, however a shorter method for
my task has stumped me.
I need to create a worksheet where I can do the following:

Let's say we have 3001 people in line.

If there are 3000(+) people behind a guy, he gets 3 apples.
If there are 2000+ (but less than 3000) people behind a guy, he gets 2
apples.
etc. and so on.
The important values would be:
#people 3000 2500 2000 1500 1000 750 500 300
#apples 3 2.5 2 1.5 1 0.9 0.8 0.7

#people 200 100 50 10
#apples 0.6 0.5 0.25 0.1

I would have to set ranges for the values. ie. If you had 751 people
behind you, you would still get 0.9 apples.

I understand that Nested IF statements only go up to 7 values. I also
tried using
=VLOOKUP(Target!A2,List!$A$2:$B$14,2,FALSE)
Where the target had the actual position of a person in line, and List
had values for the # of people and # of apples given in Ax and Bx
respectively. However that only allowed me to find exact values, not
ranges, which i need.

The ratios and # of people in behind a person would be preferrably
easily adjusted, to see the effects of a change in value.

I was wondering if anyone had a solution to my problem?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 136
Default Multiple IF Statements

Hello,

Use LOOKUP:
=LOOKUP(A1,{0,10,50,100,200,...},{0.1,0.25,0.5,0.6 ,...})
You may want to write the vectors into ranges and let lookup refer to
those...

HTH,
Bernd

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Multiple IF Statements

Both edits worked well! Thanks very much Kassie and Bernd!

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
link multiple cells to multiple cells jpoltor Excel Discussion (Misc queries) 2 March 25th 06 08:59 AM
HELP! Multiple if statements on the same line Chemboy New Users to Excel 3 January 30th 06 04:41 PM
How can I have multiple "If" statements in one formula? MikeL Excel Discussion (Misc queries) 5 January 15th 06 03:36 AM
Linking two IF statements together trixma Excel Discussion (Misc queries) 2 September 29th 05 06:07 AM
multiple IF statements Nathan McElmurry Excel Worksheet Functions 1 November 18th 04 09:22 PM


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