# IF Command Assistance -

#### John Gill

##### New Member
Hello Team

I wonder if you please help me with a nested "IF" Function formula. I am trying to put indicators as below 10, 20 & 30 in (say column B,) against a set of figures in column "A". EG figures between 10000 & 20000 =10, 20001 to 30000 = 20 & figures between 30001 to 40000 = 40.

Many Thanks

### Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

##### MrExcel MVP
try:

=FLOOR(A1/1000,10)

EDIT - but only if you didn't mean to write 40 as the option for between 30001 - 40000!!
This message was edited by PaddyD on 2002-09-22 16:28

#### John Gill

##### New Member
Thank you Paddy, but this does not overcome the problem where 20000 will be in the range to have an indicator of 10 and 30000 will be in the range to have an indicator of 20 and so on.

I thought that the nested "IF" command would overcome this problem, but I will be guided by your expertise.

Many Thanks

##### MrExcel MVP
In general, you relate one item to another using one of the lookup functions. (I only went down the floor() route 'cos I din't read your question properly!) This includes number ranges. This approach is preferable to using if's for at least 2 reasons - you aren't restricted by the 7 nested ifs limit; it forces you to keep you comparison bands etc out on the spreadsheet, not hidden away in the formulas (good for future maintenance,auditing etc).

See the simulation:
Book6
ABCDE
1BandReturnDataResult
20010
310000101100010
420001202000120
530001403050040
64000040
79999940
8
Sheet3

Notes:

1) =VLOOKUP(D2,A1:B5,2,1)

The 1 at the end tells the vlookup to search for the closest match, not an exact one.

2) In the bands, put the lowest number in the band in col A...

Does this help?

This message was edited by PaddyD on 2002-09-22 16:47

#### Dave Patton

##### Well-known Member
On 2002-09-22 16:35, John Gill wrote:
Thank you Paddy, but this does not overcome the problem where 20000 will be in the range to have an indicator of 10 and 30000 will be in the range to have an indicator of 20 and so on.

I thought that the nested "IF" command would overcome this problem, but I will be guided by your expertise.

Many Thanks

try the following Ensure that what you worded is what you require. Test the formula.

=LOOKUP(A2,{0,10000,20001,30001;0,10,20,40})

You can certainly put the Lookup information in a Table on the ss.
This message was edited by Dave Patton on 2002-09-22 16:54

Replies
5
Views
649
Replies
7
Views
314
Replies
15
Views
395
Replies
6
Views
2K
Replies
2
Views
550

1,181,095
Messages
5,928,045
Members
436,586
Latest member
latintxn

### 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