Entering a number based on it's position in a range

Scott Krause

Board Regular
Joined
Mar 8, 2009
Messages
96
I'm trying to enter data based on it's position in a range of numbers.

I'm creating a weight lifting program for our HS and need to put a certain number into a cell based on another cell, in this case R4. So here's what I'm trying to get accomplished with IF's below. If R4 is less than 135, enter 30. If R4 is greater than 135 but less than 225, enter 45. If R4 is greater than 225 but less than 315, enter 60. If R4 is greater than 315, enter 75.




=IF(R4<135,30, IF(135<R4<225,45, IF(225<R4<315,75,60)))

Thanks,

Scott Krause
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Scott Krause

Board Regular
Joined
Mar 8, 2009
Messages
96
Sorry, here's the full formula I used....



=IF(R4<135,30, IF(135

<R4< p><225,45,
IF(225
<R4<315,75,60)))<R4<315,75,60)))<R4<225,45, p IF(225<R4<315,75,60)))< IF(225<R4<315,75,60)))<R4<225,45,>
 
Last edited:
Upvote 0

BAlGaInTl

Well-known Member
Joined
May 7, 2003
Messages
1,082
I'm trying to enter data based on it's position in a range of numbers.

I'm creating a weight lifting program for our HS and need to put a certain number into a cell based on another cell, in this case R4. So here's what I'm trying to get accomplished with IF's below. If R4 is less than 135, enter 30. If R4 is greater than 135 but less than 225, enter 45. If R4 is greater than 225 but less than 315, enter 60. If R4 is greater than 315, enter 75.



=IF(R4<135,30, IF(135<R4<225,45, IF(225<R4<315,60,75)))
Thanks,

Scott Krause

If statements execute in order... so as long as you go from low to high, this should work

=IF(R4<135,30, IF(R4<225,45, IF(R4<315,60,75)))
 
Upvote 0

Scott Krause

Board Regular
Joined
Mar 8, 2009
Messages
96
Sorry, again, I can't seem to get this entire formula to show up.

=IF
(R4
<135
,30
, IF
(135
<R4
<225,
45,
IF(225
<R4
<315,
75,60)))
 
Upvote 0

BAlGaInTl

Well-known Member
Joined
May 7, 2003
Messages
1,082
The formula was all there...

The forum gets confused and truncates formulas some of the time when they contain < or >.

I simply quoted your original post to see what the formula you typed in was.
 
Upvote 0

Forum statistics

Threads
1,191,034
Messages
5,984,261
Members
439,881
Latest member
Amitoj95

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top