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

#### Scott Krause

##### Board Regular
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
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:

#### BAlGaInTl

##### Well-known Member
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)))

#### Scott Krause

##### Board Regular
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)))

#### BAlGaInTl

##### Well-known Member
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.

#### Scott Krause

##### Board Regular
That's it! Thanks!

Replies
0
Views
280
Replies
2
Views
369
Replies
3
Views
642
Replies
3
Views
501
Replies
2
Views
432

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.

### Which adblocker are you using?

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

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