Function Problems

How to Create an Excel Formula to Calculate Required Boxes or Return Done

Phi Hung VoPhi Hung Vo Nov 10, 2026 870 views

Question details

The user needs an Excel formula that checks if the available quantity meets the required quantity, returning 'Done' if true, or calculating the required number of boxes (rounded up) based on a specific items-per-box capacity if false.

How to Create an Excel Formula to Calculate Required Boxes or Return 'Done'
Product
Excel
Device & OS
not provided
Scenario
Inventory or packaging management where a specific number of items are required, and items must be packed in boxes of a fixed capacity.
Observed behavior
The formula must output either the word 'Done' or a whole number representing the required boxes calculated from the remaining shortage.
Before you start

Ensure that your required quantity and available quantity are entered into separate, identifiable cells in your spreadsheet as numerical values before applying the formula.

Solution 1Recommended

Use the IF and ROUNDUP Functions Combined

This solution combines a logical check with a rounding function to determine if more boxes are needed.

The IF function allows you to test if a condition is met, while the ROUNDUP function ensures that any partial box required is counted as a full additional box. In this scenario, we assume the required quantity is in cell A1, the available quantity is in A2, and each box contains 784 items.

1
Select the target cell

Click on the cell where you want the calculated result or status to appear.

2
Enter the combined formula

Type the formula =IF(A2>=A1,"Done",ROUNDUP((A1-A2)/784,0)) into the formula bar.

3
Apply and fill down

Press Enter to apply the formula. If you are calculating this for multiple rows, click and drag the fill handle at the bottom-right corner of the cell to apply the formula to the rest of the column.

Use the IF and ROUNDUP Functions Combined
Customize the Formula: Replace '784' with your actual box capacity, and update 'A1' and 'A2' to match the specific cell references of your required and available quantities.
Smart Inventory Management

Calculate Inventory and Packaging Seamlessly with WPS Spreadsheet

WPS Spreadsheet fully supports advanced logical and mathematical functions like IF and ROUNDUP, making it easy to manage inventory, calculate required boxes, and handle complex data tasks seamlessly.

  1. 1. Open your dataset in WPS Spreadsheet: Launch WPS Office, open Spreadsheet, and load your inventory or packaging document.
  2. 2. Input the calculation formula: Select the target cell and enter =IF(A2>=A1,"Done",ROUNDUP((A1-A2)/784,0)) to calculate the remaining boxes needed.
  3. 3. Press Enter to execute: Hit Enter to instantly see the required boxes or the 'Done' status, and drag the cell corner to fill the rest of the column.
Fully compatible with Microsoft Excel formulas and .xlsx formatsLightweight software with fast processing speeds for large datasetsBuilt-in function wizard to easily construct complex conditional formulasFree and easy-to-use interface identical to classic spreadsheet tools
microsoft office alternative - wps office

Frequently Asked Questions

What does the 0 in the ROUNDUP function mean?

The 0 in the ROUNDUP function specifies the number of decimal digits to which you want to round the number. Using a 0 ensures the result is rounded up to the nearest whole number, which is necessary since you cannot have a fraction of a physical box.

How can I change the items-per-box value dynamically without editing the formula?

Instead of hardcoding the number 784 into your formula, you can place your box capacity in a separate cell (e.g., cell B1) and reference it in the formula like this: =IF(A2>=A1,"Done",ROUNDUP((A1-A2)/$B$1,0)). Make sure to use absolute referencing ($B$1) so the value doesn't change when copying the formula down.

Why is my formula returning an error instead of 'Done'?

This usually happens if the referenced cells contain text formatting instead of numerical values. Ensure that both your required quantity and available quantity cells are formatted as Numbers and do not contain hidden spaces.

Can I use the standard ROUND function instead of ROUNDUP?

Using ROUND is not recommended for this scenario. Standard rounding rules mean a shortage of 300 items might round down to 0 boxes if the capacity is 784. ROUNDUP ensures that even a shortage of just 1 item will correctly require 1 additional box.