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.
- Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
- More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
- Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
- Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
- Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
- Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
- More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.
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.
- How to move entire row to another sheet based on cell value in Excel?
- How to calculate average in a column based on criteria in another column in Excel?
- How to automatically send email based on cell value in Excel?
- How to sum values based on selection of drop-down list in Excel?