Function Problems

Return a Queue Name Based on Weight and Volume in Excel

Camila MilosovichCamila Milosovich Nov 18, 2026 868 views

Question details

Determine a queue name from weight, volume, and product conditions in a spreadsheet.

Return a Queue Name Based on Weight and Volume in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the inputs

Enter the weight in B2, volume in B3, and product identifier in B4. Use the same units as your rule table.

2
Create the 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.

3
Test each rule

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.

4
Return the matching name

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.

Use a Rule Table and INDEX/MATCH to Return the Queue Name
Adjust the rules: Each row supports one excluded product. Add or modify conditions if your rules require multiple exclusions or other product criteria, and extend the formula ranges when adding rows.
Work with queue rules in WPS

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. 1. Open a spreadsheet: Open WPS Spreadsheets and create a workbook or open your Excel file.
  2. 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. 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. 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.
Keep weight and volume rules in an editable tableReturn N/A when no queue rule matchesOpen and save Microsoft Excel XLSX filesUse familiar spreadsheet formulas and controls
microsoft office alternative - wps office

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.