Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to assign a value or category based on a number range in Excel?

his article is talking about assigning value or category related to a specified range in Excel. For example, if the given number is between 0 and 100, then assign value 5, if between 101 and 500, assign 10, and for range 501 to 1000, assign 15. Method in this article can help you get through it.

Assign a value or category based on a number range with formula

Combine multiple worksheets/workbooks into one worksheet / workbook:

Combine multiple worksheets or workbooks into one single worksheet or workbook may be a huge task in your daily work. But, if you have Kutools for Excel, its powerful utility – Combine can help you quickly combine multiple worksheets, workbooks into one worksheet or workbook

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download the free trial Now!

Excel Productivity Tools

Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial

Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately. 60-day Unlimited Free Trial

Assign a value or category based on a number range with formula

The following formulas can help you to assign a value or category based on a number range in Excel. Please do as follows.

1. Select a blank cell, enter formula =IF(AND(A2>=0, A2<= 100), 5,IF(AND(A2>=101, A2<=500), 10, IF(AND(A2>=501, A2<=1000),15, 0))) into the formula bar, and then press the Enter key.


1. In the formula, A2>0, A2<=100, 5 means that If a given number is between 0 and 100, then assign value 5. And the others are the same meaning. Please change them to you need.

2. If the given number is not within the specified range, a 0 will be displayed.

3. This formula also can help to assign the data with text format, please apply this: =IF(AND(A2>=0, A2<= 100), "Five",IF(AND(A2>=101, A2<=500),"Ten", IF(AND(A2>=501, A2<=1000),"Fifteen", "Zero")))

2. Keep selecting the result cell, drag the Fill Handle down to get all values of given numbers based on ranges. See screenshot:

The following formula also can help you to assign specific category based on cell values, please do as follows:

1. Create a table with all number ranges and assigned categories listed inside as below screenshot shown.

2. Select a blank cell adjacent to the given number, enter formula =VLOOKUP(A13,$A$2:$C$4,3) into the Formula Bar, and then press the Enter key. See screenshot:

Note: In the formula, A13 is the cell contains the given number you will assign category based on, $A$2:$C$4 is the table range you created in step 1, and number 3 is the column number with the assigned value in the table.

3. Then drag the Fill Handle down to get all results.

Office Tab - Tabbed Browsing, Editing, and Managing of Workbooks in Excel:

Office Tab brings the tabbed interface as seen in web browsers such as Google Chrome, Internet Explorer new versions and Firefox to Microsoft Excel. It will be a time-saving tool and irreplaceble in your work. See below demo:

Click for free trial of Office Tab!

Office Tab for Excel

Related articles:

Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for you.

  • Designed for 1500+ work scenarios, helps you solve 80% Excel problems.
  • Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  • Being used by 110,000 elites and 300+ well-known companies.

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.