6. Tables, Sorting and Filtering
6.11 Writing Formulas in a Normal Range vs in an Excel Table
Apply the same rule to every order
A fictional grocery coordinator receives a sheet with an order ID, city, quantity and unit price for each purchase. They need an amount for each row and a practice service charge calculated from that amount. Multiplying the correct two cells is manageable for one order. Applying that rule consistently as more orders arrive is the real job. Excel provides two ways to describe the inputs: worksheet positions such as C2 and D2, and named Table columns such as Qty and Price.
A relative reference is an address that can shift when a formula is filled or copied. Put =C2*D2 in E2. When copied one row lower, it becomes =C3*D3. A calculated column is a Table column that repeats a formula for its data rows. In a Table, =[@Qty]*[@Price] tells Excel to multiply Qty by Price in the current record. Seeing the same formula text in several Table rows is expected. The current-row marker @ lets the calculation use each row’s own inputs.
The records are imaginary examples based on familiar ordering contexts from Blinkit and Amazon Now, and the second exercise is an invented food delivery practice case inspired by Swiggy. The proposed charges and prices are workbook inputs. The practice percentage is an exercise in formula design.
Read the scope of a reference
Relative addresses move along the grid
In the ordinary source, row 2 has quantity 2 and price 32. Cell E2 reads the inputs C2 and D2 and returns 64. Filling E2 into E3 moves each relative reference by one row. For the next order, quantity 3 and price 90 yield 270. The amount changes even when your workbook uses the same multiplication rule. Check the formula bar at the destination to see the new row numbers. Applying a currency format does not affect the multiplication.
A fixed parameter supplies the same value for every row
Suppose everyone uses one fictional service rate from Settings B2. In a normal range, =E2*Settings!$B$2 multiplies the current order amount by the fixed parameter. The dollar signs hold both parts of the B2 address when you fill or copy the formula. A dollar sign here is an address marker. In a formula like =E2*Settings!B2, the rate reference would move to B3 after copying down one row. That can generate an amount of zero when B3 is empty, making the result look plausible while applying the wrong source.
You can also give the rate cell a defined name, such as Practice_Rate, with workbook scope. Then a formula on another sheet can use =E2*Practice_Rate or =[@Amount]*Practice_Rate. Verify the name points to the one rate cell in Settings. A workbook-level name can communicate the purpose of a fixed address and make a later rate change easy to test. It also means that each formula using the name will read the new value. If rates differ by period or order, keeping one single rate cell would be the wrong source design for historical calculations.
The whole column and current row answer different questions
- One record. Inside the Table,
[@Amount]reads the current row’s result. On the first order that value will be 64. - The entire data field.
tblSales[Amount]is the Table’s data-body column. Use=SUM(tblSales[Amount])on the check sheet for all its member amounts. - A report for a selected view. To follow visible rows, use an appropriate
SUBTOTALformula. A full-column reference by itself does not respect filtering. Determine whether you want all amounts or just the visible set first. - An outside reference. Use the Table and field names when the formula is elsewhere. Inside a calculated column, the current-row name gives useful context. Outside the Table, a current-row shorthand without the name or a suitable row context is not a way to identify an arbitrary order.
Separate formula notation from the fill mechanism
A Table can fill a calculated column even when the formula uses explicit A1 references. You can enter =C2*D2 into an empty Table result column. Excel can propagate it while adjusting the addresses per row. A structured reference can make the source fields easier to read, especially when other people review the formula later. Removing structured notation does not turn the Table itself into a normal range. Likewise, creating a Table does not rewrite all existing A1 references. Change references only where their intended source should track the Table.
Build a calculated column by entering the intended formula in an empty Table column. Forecast its outputs for two records and confirm they appeared. Excel documents automatic propagation and extension to new Table rows. Other values already in the result column, intentional exceptions, an import of data over the formula, or differences in options can affect the observed fill. Check the actual formula at the bottom of the Table. If you must repeat a formula explicitly, use the appropriate fill command and verify the rows. On a normal range, choose the fill boundaries deliberately rather than counting on a nearby used column.
An exception is one Table cell whose formula or value differs from the column’s normal calculated rule. For example, pasting a number over an Amount formula creates a result that no longer changes with Qty or Price. Excel error checking can flag inconsistent formulas. A missing warning does not guarantee that every row follows the intended rule. A change to the policy belongs in the formula and a legitimate per-order override belongs in its own input field, as the second lab shows.
Lab 1. Build the same two calculations in two layouts
Use a scratch workbook with GridOrders, TableSales, Settings and Check tabs. On Settings type Practice rate in A2 and numeric 5% in B2. Typing the percent sign enters a value of 0.05 in this workbook. Entering only 5 would mean five times an order amount rather than five percent. Define the workbook-level name Practice_Rate for Settings B2 if that naming feature is available. You can use the specified absolute address in both designs in a client without name creation.
| Order ID | City | Qty | Price | Amount | Practice Charge |
|---|---|---|---|---|---|
| BLK-1001 | Pune | 2 | 32 | 64 | 3.20 |
| BLK-1002 | Nashik | 3 | 90 | 270 | 13.50 |
| AMN-1003 | Pune | 1 | 110 | 110 | 5.50 |
| BLK-1006 | Pune | 5 | 30 | 150 | 7.50 |
| BLK-1010 | Nashik | 1 | 90 | 90 | 4.50 |
Build and verify the row formulas first
- Start with GridOrders. With only the input fields populated, put
=C2*D2in E2 and=E2*Settings!$B$2in F2. Fill the two formulas through row 6 using the available Fill Down command or another deliberate copy method. The fifth record must show amount 90 and charge 4.50. Inspect E6 and F6 to verify the adjusted row and fixed parameter. - Build the Table calculation. On TableSales convert the six-column A1:F6 layout to a Table with headings. Leave the result fields initially blank. Name the Table
tblSaleswhere applicable. In the first Amount cell type=[@Qty]*[@Price]. In the first Practice Charge cell type=[@Amount]*Practice_Rate, or use=[@Amount]*Settings!$B$2. Check the formulas filled the other four rows, and inspect E6 and F6 rather than relying on the displayed amounts alone. - Make four reference checks. In Check, use
=SUM(GridOrders!E2:E6)and=SUM(GridOrders!F2:F6)for the fixed grid outputs. Use=SUM(tblSales[Amount])and=SUM(tblSales[Practice Charge])for the Table outputs. Expect 684 and 34.20 for both versions. Keep labels on the checks, and verify normal currency formatting does not change their stored values. - Append the same test order. In A7:D7 on each sheet type AMN-1011, Kolhapur, 4, 58. In the ordinary range, deliberately leave the extra result cells without an explicit fill for this test. A client may offer to extend or copy formulas. Even if E7 and F7 fill, the fixed range totals on Check still address E2:E6 and F2:F6. In TableSales verify the new row is a Table member and both calculated fields are filled. If necessary insert the row through the Table controls and repair any missing formulas in the practice column.
- Reconcile the new results. The added row has amount 4 × 58 = 232 and charge 11.60. The Table totals become 916 and 45.80. The fixed checks stay 684 and 34.20 until you extend their ranges. To make the normal range cover the same six orders intentionally, fill E7 and F7 if needed and update the fixed checks to use row 7. Both versions should then agree.
Trace the sixth order from inputs to report
Read Qty and Price
AMN-1011 has Qty 4 and Price ₹58. The amount rule should use those two values in its own row.
Calculate its amount
Use C7 × D7 or this row’s Qty × Price. Either produces ₹232.
Apply the shared rate
₹232 × 0.05 yields ₹11.60. Both formulas should point to the single Settings value.
Check the column reference
Six included amounts sum to ₹916. A fixed range ending at row 6 still reads five amounts and returns ₹684.
Change the shared input without changing the formula
Once both sides include six orders, replace the practice rate in Settings B2 with 8%. In the first row the service charge becomes ₹5.12. The newest order’s charge becomes ₹18.56. Across all six orders the total charge is ₹73.28. The amount column stays at ₹916. This reflects a change to the parameter rather than a change to the multiplication formula. Restore 5% at the end. If an order’s charge stays at its old value while others change, inspect that formula because it could have been overwritten with a number or linked to another parameter.
Lab 2. Keep overrides as inputs and preserve one rule
An imaginary meal delivery workshop has a standard unit price for each item. Two orders have an intentional override. One is a reduced price. One is free, so its numeric override is 0. The lead needs future price changes to keep working for other orders and wants the spreadsheet to explain where an override came from. A separate Price Override input lets you keep the Effective Price and Amount formulas intact.
| Receipt | Qty | Unit Price | Price Override | Effective Price | Amount | Override Status |
|---|---|---|---|---|---|---|
| PK-01 | 2 | 70 | 70 | 140 | Standard | |
| PK-02 | 3 | 40 | 35 | 35 | 105 | Override |
| PK-03 | 1 | 90 | 0 | 0 | 0 | Override |
| PK-04 | 4 | 25 | 25 | 100 | Standard |
Make the decision before multiplying
Create a Table from Packing A1:G5, including the three initially empty result columns, and name it tblPacking where possible. Enter these expressions in their own result columns and confirm each fills to the last record. Two fields in this example have spaces in their labels. Keep the extra brackets in the current-row expressions for those names. The @ applies the rule to this record’s field.
- Effective Price in E2.
=IF(ISNUMBER([@[Price Override]]),[@[Price Override]],[@[Unit Price]]) - Amount in F2.
=[@Qty]*[@[Effective Price]] - Override Status in G2.
=IF(ISBLANK([@[Price Override]]),"Standard",IF(ISNUMBER([@[Price Override]]),"Override","Review"))
Here IF chooses between two results. ISNUMBER tests whether the override cell stores a number. This accepts a valid numeric zero and rejects text digits. ISBLANK checks whether the input cell is genuinely empty. In this controlled practice dataset the column is entered by hand. A formula that displays empty text is a different kind of cell and can require a different test in an imported source. Price Override tells you the requested change. Override Status explains the row decision, and Amount calculates the downstream result. Review means inspect the input before using it as a final bill.
Verify one standard price, one reduction and one free order
- Read the rows and compare all three output fields with the table. The sum across the four amounts is ₹345. If PK-02 had no override it would cost ₹120. If PK-03 had no override its single item would cost ₹90. Without either override the four orders would therefore total ₹450.
- Check that clearing PK-03’s override is different from entering the number 0. Clear it temporarily. The row moves to Standard and shows ₹90, so the total becomes ₹435. Restore numeric zero and verify the row changes back to Override and amount zero. Empty and zero now produce visibly different behavior.
- Change PK-02’s override to text by entering
'35. The cell may show the same digits, but ISNUMBER is false. Override Status should be Review. The effective price uses the standard ₹40 under this practice policy and yields ₹120. The total becomes ₹360. Review the original source and restore numeric 35 so the report returns to ₹345. - Append PK-05, Qty 2, Unit Price 60 and Price Override 50. Verify actual Table membership and inherited formulas for the three fields. Expected effective price is ₹50, expected amount ₹100, and override status Override. The named-column total rises to ₹445. Check that the original PK-03 stays at zero, proving the new row did not overwrite the intended shared rule.
- Explain where a future pricing requirement belongs. If the exception rule itself changes, edit the calculated column and test a set of known records. If one receipt has a verified different price, put that input in Price Override and verify the output for that receipt. Changing a formula cell into a pasted numeric total makes later Qty changes invisible to its pricing rule.
Use mixed references for a small rate comparison grid
A supervisor might want to see the same amounts under three possible rate assumptions. A plain worksheet grid is convenient for this comparison because the inputs have two directions. Put amounts 64 and 232 in Scenarios A2:A3. Put rates 5%, 8% and 12% in B1:D1. Enter =$A2*B$1 in B2 and fill across to D2 and down through row 3. The dollar sign before A keeps the amount in column A while row number changes. The sign before 1 keeps the rates in row 1 while column changes.
- At B2: use A2 and B1, showing ₹3.20.
- At C2: use A2 and C1, showing ₹5.12. At D2 the 12% result is ₹7.68.
- At B3: use A3 and B1, showing ₹11.60. At C3 and D3 expect ₹18.56 and ₹27.84.
If you accidentally fix $A$2, every result row reads 64. If you leave B1 completely relative, a fill down can read a result cell instead of a rate. Write out the coordinates at the far corner and test D3 before multiplying the grid by many more columns and rows. This is why mixed references are still valuable even in workbooks with well-designed Tables. The orders have a clean record structure. The sensitivity grid deliberately compares inputs across two axes.
Catch an overwritten formula before it reaches a report
An amount pasted over a formula can initially look completely correct. On a copy of the six-order TableSales example, inspect AMN-1003. Its quantity is 1 and its price is ₹110, so the formula produces ₹110. Replace just that row’s Amount formula with a typed 110. Keep the other formulas intact. The visible number and whole-column sum of ₹916 have not changed. The formula bar now shows a stored value in that row rather than a rule. A reviewer who checks only the totals at this point might miss the problem.
Change one input to reveal the dependency
- Make sure the rate is set to 5%. Change AMN-1003’s quantity from 1 to 2 in the scratch table. Its result should follow Qty times Price, giving ₹220. A pasted amount of 110 cannot react to that input.
- The old charge for that record is ₹5.50. The correct new charge is ₹11.00. The charge formula can be present and still read the stale amount. A single formula exception can therefore affect another calculated column that appears to use the correct rule.
- With the amount still pasted, the six-order amount remains ₹916 and the charge total remains ₹45.80. The correct amounts after replacing just that row’s rule are ₹1,026 and ₹51.30. The order increase explains both differences: ₹110 more in Amount, and 5% of that difference, ₹5.50, in charge.
- Restore the formula in AMN-1003’s Amount cell. For this controlled review you can copy the proven formula rule from another Amount cell and check all six row results on the scratch copy. Then restore the original quantity of 1 and verify the original totals. If your client propagates a formula edit to other rows, check those results before saving the exercise.
Check the underlying inputs with a second calculation
Add an independent control on Check with =SUMPRODUCT(tblSales[Qty],tblSales[Price]). SUMPRODUCT multiplies two aligned lists pair by pair and adds those products. The Qty and Price fields use the same Table rows in the same order. With properly typed numeric input it gives ₹916 in the original six-order case. The version with AMN-1003 doubled gives ₹1,026. The overwritten Amount cell is outside its input, so the mismatch identifies a problem downstream of the actual quantity and price.
The ordinary range equivalent can use =SUMPRODUCT(GridOrders!C2:C7,GridOrders!D2:D7) with six source records. Both ranges must cover the same rows. Pointing Qty at C2:C7 and Price at D2:D6 gives mismatched lengths. Even if two lists are the same length, use the same record boundaries so the price for one order is never multiplied by another order’s quantity. Microsoft notes that nonnumeric array entries are treated as zeros when those inputs are passed as separate arrays. Keep a count of valid quantity and price inputs as a separate quality check. A matching total does not prove the data is valid.
Review the relationship between this arithmetic and the override lab. For Packing, the charged amount uses Effective Price. A control formula using the original Unit Price would produce ₹450 with the first four rows, while the proper amount is ₹345. This difference is intended after verified overrides. The correct independent control should compare Qty with the selected effective inputs or explicitly account for each override. Before accusing a sheet of inconsistency, check whether the two expressions are supposed to implement the same business rule.
Copy calculations without mixing them with input values
Plan which columns someone enters and which columns Excel calculates
Mark Order ID, City, Qty and Price as input fields in the first exercise. Amount and Practice Charge are outputs. When pasting the new order from an import, paste only to the four input fields. A six-column paste containing blank results or fixed values could overwrite live calculation cells along with the raw inputs. Confirm the last row’s Amount and Practice Charge are formulas after the paste. Color or labels can support this workflow, but knowing the actual column boundaries is what protects the calculations.
Keep a separate scratch sheet for training calculations that compare one formula with another. If you want to fill a first-row ordinary amount and charge down the original set, select the correct rectangular fill range in both output columns. Before filling, inspect the first row’s two formulas. Check that the filled example in row 6 uses C6 and D6 for Amount, and E6 with fixed Settings B2 for the charge. The same reference labels should identify the same field in the Table version. A formula in the wrong column may still return a number in a row containing several numeric fields.
Test a rate entry that is numeric but uses the wrong scale
A new user may enter 5 in a General-format cell intending to say five percent. That stored value is five. If the Settings cell is already in Percentage format, Excel’s treatment of typed entries can differ, so run the experiment on a separate scratch setting with General format or deliberately inspect the stored value. Use that test value 5 in the formula once. The first charge is ₹320 and the six-order sum is ₹4,580. Those results are a hundred times the intended ₹3.20 and ₹45.80. Replace it with the numeric fraction 0.05 or a correctly entered 5%, then retest both settings and calculations.
In this fictional practice policy, compare the stored rate with the permitted scale before trusting the report. Validating that a value is numeric only establishes a type. Checking the intended scale and an independently calculated first-row charge can catch an entry that the formula accepts but the model did not intend.
Read common formula review failures
- The percentage drifts after a copy. Put 5% only in Settings B2 and leave B3 empty. An unanchored reference to Settings B2 in row 2 can move to B3 at row 3 and silently produce zero. Inspect F3 and verify ₹13.50. Then repeat after locking the reference or using the verified name. The fixed choice should keep the rate constant when copied down.
- A formula uses an input from the wrong record. Reconcile by ID and inspect the source coordinates. At row 3 of the unchanged exercise, Qty 3 and Price 90 should produce 270. Multiplying the right quantity by the previous row’s 32 would give only 96. The column’s total could appear reasonable, especially if only one row is affected. A check of known calculations catches row-level slips directly.
- A worksheet was converted after formulas were already correct. Decide whether they should remain fixed controls or follow new records. A fixed benchmark may intentionally stay on the first five. Update only the calculations that should follow changing Table membership. Conversion is a chance to inspect formula purposes rather than to rewrite every working reference.
Write a short comment or note for each key rate and aggregate before handing over a workbook. A formula with meaningful field names helps the next student read it. A source count and a specific test value give them enough evidence to tell when a new input, copy operation or range expansion changes the result.
Preserve the rule that applies to each order
A single rate cell is appropriate when all rows should use a current scenario. It is a different design from a historical report where the rate charged at the time of an order should stay attached to that order. Suppose the first five records were approved with a 5% practice rate and the sixth should use 8%. If you overwrite the shared Rate cell with 8%, the new charge total is ₹73.28 because every record now uses 8%. The intended historical total is ₹52.76: the original five charges total ₹34.20, plus the sixth order’s ₹18.56. Both formulas can be mathematically correct for different workbook questions.
One simple practice design is to add a Rate At Order input column, set the first five records to numeric 5% and set the sixth to numeric 8%. Calculate charge by multiplying this row’s Amount and its own Rate At Order. In a Table, the two current-row references identify the intended record. In a plain range, the corresponding same-row cell addresses work as well. Changing today’s scenario cell then cannot alter those row-level inputs. Check both the numerical total and the oldest and newest rates. If the true rate comes from customer terms or a schedule, document its approved source before entering any values.
Choose the point at which currency must round
The fixtures so far give exact two-decimal currency amounts. A different source could produce finer results. Imagine three practice orders of ₹2.50 with the same 5% practice charge. Each unrounded charge is ₹0.125. With a two-decimal number format each cell can display ₹0.13. A sum of the unrounded values is ₹0.375, which may display ₹0.38. If the approved exercise requires each order’s charge to be stored to two decimal places first, use =ROUND([@Amount]*Practice_Rate,2) in the Table. In that exercise each rounded charge is ₹0.13 and the sum is ₹0.39. Decide which policy the assignment uses before changing the formula, and communicate the policy in a label. A display format alone does not say where you decided to round.
Debug the formula, inputs and aggregate separately
Find one record that isolates the symptom
- Only the first row looks right. Inspect the row references after filling. The third record uses its own quantity and price. In the rate formula, check that the setting stays fixed while the order amount changes.
- A number in one row stops responding. On a scratch copy, edit the related input and see whether the result changes. Inspect the formula bar for a value or formula exception. Restore the standard rule or move the documented difference into a separate input column.
- The results did not propagate down the Table. Confirm the result field is actually part of the Table and was empty before entering the rule. Check for previous formulas or pasted values. Reinitialize the desired column on a scratch copy and verify the last row and a new member.
- A named rate shows a name error. Check the exact spelling and scope. Inspect the referenced cell and test using the explicit Settings address to isolate whether the issue is the name or the data.
- New result is right but total misses it. Read the summary reference. A fixed total may omit the new address. A Table total depends on the actual table boundary. Enter the row’s expected amount next to the checked result on a separate sheet so you can confirm the difference matches exactly.
- An imported price looks plausible but is text. Inspect the stored type. ISNUMBER can help find the issue. Keep numeric amount fields as numbers and apply formatting separately. Do not edit an order ID that intentionally preserves a text prefix or leading zeros.
Use a three-case formula review
Look at a standard input, a boundary input and an exception. In Packing, PK-01 checks the standard price, PK-03 checks an override of zero and PK-02 with text digits checks how the model reports an unexpected type. For a fourth check, add a record at the end. If those cases all match expectations, you have checked more than formula syntax. You know the policy is applied in ordinary use and when the source grows.
Quiz. Trace addresses, values and row scope
Which reference changes when the normal formula is filled from F2 to F3?
The order amount reference changes from E2 to E3. The absolute Settings reference stays at B2. The change gives the next order its own amount and the same practice rate.
What does @ in the Qty field mean?
It names the Qty from this record. With Qty 4 and Price ₹58, the calculated amount is ₹232 regardless of the worksheet’s current row number after a suitable full-record sort.
Why can the range total remain ₹684 with a correct amount in E7?
The original sum reads only through row 6. Adding or filling row 7 does not include E7 in that particular address. Extend the formula intentionally or use the full data field of the correctly sized Table.
What should the practice charge be for the new ₹232 row at 8%?
₹18.56. Multiply 232 by 0.08. The amount stays ₹232. The rate change affects the charge derived from that amount.
When does PK-03’s price become zero?
When its override input stores numeric zero, ISNUMBER is true and the formula uses that zero. Clearing the cell restores the standard ₹90, and a text value requires review.
Which two addresses does the mixed-reference formula use at D3?
It uses A3 and D1. The amount column stays A while the row follows the output row. The rate row stays 1 while the column follows the output column. The two values are 232 and 12%, producing ₹27.84.
Interview practice. Explain the design decision
How do you show that a Table calculated column is working?
Enter the rule into an empty result column, inspect formula text and predicted results on more than one original record, then append a known order and verify membership and the inherited formula. In the lab the new amount should be ₹232. Reconcile the independent named-column total to the six order amounts.
How are calculated columns different from structured references?
A calculated column is a behavior that applies a rule to the Table’s rows. Structured references are a way to identify Table fields or the current record. Excel can propagate explicit cell references in a calculated column as well. Choose named fields to communicate the meaning of the inputs clearly.
Why keep an override separate from an amount formula?
Keeping the override as an input preserves the same effective-price rule through the entire column. The reviewer can see the original and override values and verify which one was used. A value pasted over the Amount formula no longer responds to input changes.
Is a named rate cell always appropriate?
It is useful for a scenario shared across every record. A historical charge can need the rate that applied to its specific order. Keep that input with the record or obtain it from an approved lookup, then use a current-row calculation to preserve the different rates.
Why could a sum differ from the displayed amounts added by hand?
Currencies can display two decimals while formulas store smaller fractions. Check the rounding policy. In the tiny charge example, rounding each row first yields ₹0.39, and summing before rounding yields ₹0.38. The required convention determines the correct result.
Revision cards
- Relative address. Copying down changes the order cell’s row number.
- Fixed input. Use absolute coordinates or a verified name for one shared setting.
- Current record. The Table’s @ marker identifies a field from this row.
- Whole data column. Refer to the Table and field name when summing across every member.
- Exception input. Store a justified override separately from the formula it affects.
- Verify expansion. Check the input row, the per-row calculation and the independent total.
Microsoft references
Continue practising: explore the existing Excel Task Hub for additional exercises.