Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Urgent help on IF please!

How can I create an IF formula that shows that if the number is
between 0 and 500 it is 0, if it is between 500 and 1000 it is 1, if
it is between 1000 and 1500 it is 2. For example: H5 calculates
number of gallons. And, I5 should calculate that if H5 is between 0
and 500 it is 0, if H5 is between 500 and 1000 it is 1, if it is
between 1000 and 1500 it is 2. I did this, but it does not work
=IF(H5=500,1,IF(H5=1000,2,IF(H5=1500,3))) How can I do that? I
would appreciate your help. Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Urgent help on IF please!

How can I create an IF formula that shows that if the number is
between 0 and 500 it is 0, if it is between 500 and 1000 it is 1, if
it is between 1000 and 1500 it is 2. For example: H5 calculates
number of gallons. And, I5 should calculate that if H5 is between 0
and 500 it is 0, if H5 is between 500 and 1000 it is 1, if it is
between 1000 and 1500 it is 2. I did this, but it does not work
=IF(H5=500,1,IF(H5=1000,2,IF(H5=1500,3))) How can I do that? I
would appreciate your help. Thanks.


=INT(H5/500)

Rick
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Urgent help on IF please!

In article ,
"Rick Rothstein \(MVP - VB\)"
wrote:

How can I create an IF formula that shows that if the number is
between 0 and 500 it is 0, if it is between 500 and 1000 it is 1, if
it is between 1000 and 1500 it is 2. For example: H5 calculates
number of gallons. And, I5 should calculate that if H5 is between 0
and 500 it is 0, if H5 is between 500 and 1000 it is 1, if it is
between 1000 and 1500 it is 2. I did this, but it does not work
=IF(H5=500,1,IF(H5=1000,2,IF(H5=1500,3))) How can I do that? I
would appreciate your help. Thanks.


=INT(H5/500)


Note that this works fine as long as H5<2000, but if H5 is ever =2000
will return a value 3. Of course, that may be what you want, but it
isn't in your specification.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Urgent help on IF please!

How can I create an IF formula that shows that if the number is
between 0 and 500 it is 0, if it is between 500 and 1000 it is 1, if
it is between 1000 and 1500 it is 2. For example: H5 calculates
number of gallons. And, I5 should calculate that if H5 is between 0
and 500 it is 0, if H5 is between 500 and 1000 it is 1, if it is
between 1000 and 1500 it is 2. I did this, but it does not work
=IF(H5=500,1,IF(H5=1000,2,IF(H5=1500,3))) How can I do that? I
would appreciate your help. Thanks.


=INT(H5/500)


Note that this works fine as long as H5<2000, but if H5 is ever =2000
will return a value 3. Of course, that may be what you want, but it
isn't in your specification.


I thought he simply got tired of type.<g

Good point, though... I shouldn't have assumed that.

Rick
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Urgent help on IF please!

=INT(H5/500)

Note that this works fine as long as H5<2000, but if H5 is ever =2000
will return a value 3. Of course, that may be what you want, but it
isn't in your specification.


I thought he simply got tired of type.<g


And the reason I thought that was because the OP started by saying...

How can I create an IF formula that shows that if the number is
between 0 and 500 it is 0, if it is between 500 and 1000 it is 1, if
it is between 1000 and 1500 it is 2.


and then later on gave this example...

=IF(H5=500,1,IF(H5=1000,2,IF(H5=1500,3)))


adding the H5=1500 producing 3 condition.

Rick


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Urgent help on IF please!

One way:

=MIN(INT(H5/500),3)

Note that in your formula, if H5 = 1000, then H5 is also =500, so the
true branch is taken. You could reformat your IF() function:

=IF(H5<500,0,IF(H5<=100,1,IF(H5<=1500,2,3)))



In article .com,
cimbom wrote:

How can I create an IF formula that shows that if the number is
between 0 and 500 it is 0, if it is between 500 and 1000 it is 1, if
it is between 1000 and 1500 it is 2. For example: H5 calculates
number of gallons. And, I5 should calculate that if H5 is between 0
and 500 it is 0, if H5 is between 500 and 1000 it is 1, if it is
between 1000 and 1500 it is 2. I did this, but it does not work
=IF(H5=500,1,IF(H5=1000,2,IF(H5=1500,3))) How can I do that? I
would appreciate your help. Thanks.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Urgent help on IF please!

=IF(H51500,3,IF(H51000,2,IF(H5500,1,0)))

"cimbom" wrote:

How can I create an IF formula that shows that if the number is
between 0 and 500 it is 0, if it is between 500 and 1000 it is 1, if
it is between 1000 and 1500 it is 2. For example: H5 calculates
number of gallons. And, I5 should calculate that if H5 is between 0
and 500 it is 0, if H5 is between 500 and 1000 it is 1, if it is
between 1000 and 1500 it is 2. I did this, but it does not work
=IF(H5=500,1,IF(H5=1000,2,IF(H5=1500,3))) How can I do that? I
would appreciate your help. Thanks.


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
IME MODE FOR EXCEL 2007 (URGENT URGENT) Stella Wong Excel Discussion (Misc queries) 1 August 23rd 08 11:16 PM
Urgent-Urgent VBA LOOP Jeff Excel Discussion (Misc queries) 0 October 6th 05 05:46 PM
Urgent Urgent Excel Discussion (Misc queries) 3 September 10th 05 10:07 AM
Macro help urgent urgent Dave Peterson[_3_] Excel Programming 0 September 4th 03 03:59 PM
Macro help urgent urgent chandra Excel Programming 0 September 4th 03 03:50 PM


All times are GMT +1. The time now is 05:14 AM.

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

About Us

"It's about Microsoft Excel"