Return a Queue Name Based on Weight and Volume in Excel
Question details
Determine a queue name from weight, volume, and product conditions in a spreadsheet.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Assign a set name such as G1 CARTON, G1 LINE, or G1 PALLET using defined weight and volume ranges and product exclusions.
- Observed behavior
- The desired result is the first matching queue name, or N/A when no rule matches.
Confirm the actual weight and volume ranges, units, product exclusions, and rule priority before building the table. Decide whether each boundary is inclusive; the example below includes the minimum and excludes the maximum.
Use a Rule Table and INDEX/MATCH to Return the Queue Name
Use this approach to keep queue rules easy to review and update without deeply nested IF formulas.
The ranges and exclusion below are illustrative, not the actual queue rules. Replace them with your requirements and put higher-priority rules first; the formula returns the first match.
Enter the weight in B2, volume in B3, and product identifier in B4. Use the same units as your rule table.
In A5:G5, enter Queue, Min Weight, Max Weight, Min Volume, Max Volume, Excluded Product, and Match. For an example, enter G1 CARTON, 0, 10, 0, 1, and ST 3001 in A6:F6; enter G1 LINE, 10, 50, 0, and 2 in A7:E7; and enter G1 PALLET, 50, 100, 0, and 5 in A8:E8. Leave F7:F8 blank.
In G6, enter =IF(AND($B$2>=B6,$B$2<C6,$B$3>=D6,$B$3<E6,OR(F6="",$B$4<>F6)),1,0), then fill the formula down through G8.
In an empty result cell, enter =IFERROR(INDEX(A6:A8,MATCH(1,G6:G8,0)),"N/A"). The formula returns the first matching queue or N/A if none matches.

Build the Same Queue Lookup in WPS Spreadsheets
Use a rule table, helper column, and INDEX/MATCH in WPS Spreadsheets to assign queue names from weight, volume, and product inputs.
- 1. Open a spreadsheet: Open WPS Spreadsheets and create a workbook or open your Excel file.
- 2. Enter inputs and rules: Enter weight, volume, and product in B2:B4. Create the queue rule table in A5:G8 using the column layout and actual ranges described above.
- 3. Calculate matches: In G6, enter =IF(AND($B$2>=B6,$B$2<C6,$B$3>=D6,$B$3<E6,OR(F6="",$B$4<>F6)),1,0), then fill it down for each rule.
- 4. Return the queue: In an empty cell, enter =IFERROR(INDEX(A6:A8,MATCH(1,G6:G8,0)),"N/A") and test it with your input values.

Frequently Asked Questions
What happens if two queue rules match?
MATCH returns the first row with a 1 in the Match column. Put higher-priority rules above lower-priority rules in the table.
Why does the formula return N/A?
N/A appears when no rule matches all conditions. Check B2:B4 against the rule ranges and exclusions, and confirm that the lookup ranges include every rule row.
Are the maximum weight and volume included?
No. The example uses < for maximum values, so a value equal to a maximum is excluded from that row. Change < to <= in the helper formula if your rules require inclusive maximums.
How do I add another queue rule?
Add a row beneath the existing rules, fill down the Match formula, and extend both ranges in the INDEX/MATCH formula to include the new row.




