3. Formulas and Functions
One order sheet, three different questions
A report reaches your team at the start of a shift. It lists ten practice orders. A teammate asks for the value of orders delivered in Pune, the number of delivered orders that took more than twelve minutes, and a label to show which rows need a closer look. Each answer uses the same sheet. Each answer uses a different kind of formula.
The dataset uses recognizable shopping platforms as context. Every order, amount, status, date and service threshold is fictional. The data teaches spreadsheet reasoning and describes no actual Blinkit or Amazon Now reporting process. When a lesson uses the same order examples, you can begin with the dataset on this page. Some later lessons supply a smaller fixture to isolate a behavior such as an empty cell or a unit conversion.
A formula tells Excel to calculate a result when it evaluates a cell. A formula can combine values, addresses, calculation symbols, or functions. A function is a built-in operation that accepts the inputs it needs. In =SUM(G2:G11), the leading equals sign tells Excel to evaluate the expression. The function is SUM. The input, also called an argument, is the block of amount cells from G2 through G11.
Compare that formula with =G2+G3. Both are formulas. The second one uses an operator, which is a symbol that gives Excel an operation to perform, and names only two cells. If you have typed worksheet data before but never written a formula, begin with two known amounts and predict their sum. Move to the full range when you can explain every part of the smaller example.
Set up the Orders practice sheet
Use a blank workbook or a fresh copy dedicated to this chapter. Rename one worksheet Orders. Put the nine headings in row 1, and enter the ten records in order. Keep your calculations outside the data block unless a lab asks you to add a results column. A summary on the right of the same sheet is a low-friction first test. You can eventually build a separate report sheet once you know the addresses and assumptions.
Each heading names a field, which is one piece of information about a row. For example, column C stores the city. Column I stores the status. One column keeps the same meaning across every order. On row 4, the word “Pune” belongs to the same record as amount 110 and the status “Delivered.” A criteria formula uses this alignment to ask several questions about the same row.
| Row | A Order ID | B Date | C City | D Platform | E Category | F Qty | G Amount | H Mins | I Status |
|---|---|---|---|---|---|---|---|---|---|
| 2 | BLK-1001 | 2 Nov 2026 | Pune | Blinkit | Dairy | 2 | 64 | 9 | Delivered |
| 3 | BLK-1002 | 2 Nov 2026 | Nashik | Blinkit | Fruits | 3 | 270 | 12 | Delivered |
| 4 | AMN-1003 | 3 Nov 2026 | Pune | Amazon Now | Snacks | 1 | 110 | 14 | Delivered |
| 5 | BLK-1004 | 3 Nov 2026 | Nagpur | Blinkit | Fruits | 2 | 240 | 11 | Cancelled |
| 6 | AMN-1005 | 4 Nov 2026 | Kolhapur | Amazon Now | Dairy | 4 | 232 | 16 | Delivered |
| 7 | BLK-1006 | 4 Nov 2026 | Pune | Blinkit | Bakery | 5 | 150 | 8 | Delivered |
| 8 | BLK-1007 | 5 Nov 2026 | Solapur | Blinkit | Home | 1 | 1299 | 18 | Delivered |
| 9 | AMN-1008 | 6 Nov 2026 | Sambhaji Nagar | Amazon Now | Staples | 3 | 195 | 10 | Returned |
| 10 | BLK-1009 | 7 Nov 2026 | Pune | Blinkit | Snacks | 2 | 220 | 13 | Cancelled |
| 11 | BLK-1010 | 8 Nov 2026 | Nashik | Blinkit | Fruits | 1 | 90 | 17 | Delivered |
Check the inputs before testing the formulas
- Keep each ID exactly as shown. The hyphen separates a source prefix from a numeric-looking suffix. These IDs identify rows. That suffix is part of a code and can have leading zeros in another dataset.
- Enter Qty, Amount and Mins as numbers. Type 1299 for the large order and apply currency formatting after entry. A currency symbol is a display property when you use number formatting. A pasted string with unexpected punctuation may still need conversion.
- For the date labs, use actual Excel dates. In B2 and B3 you can use
=DATE(2026,11,2)so the month and day are unambiguous. B4 and B5 use 3 as the third argument, and subsequent rows use the days in the table. Change the date display if necessary. The numbers labs on this page only depend on C and F through I. - Keep the status words as shown and the minutes cell numeric, including row 3 at exactly twelve. This row is a test at the threshold. It helps distinguish “more than twelve” from “twelve or more.”
- Use the function argument separator accepted by your Excel setup. These examples show commas. Some regional settings use semicolons between arguments. The colon in a cell range such as
G2:G11still connects the first and last addresses.
Turn a question into instructions for Excel
When a teammate asks for the “numbers for Pune,” the question needs more detail before it can become a formula. Ask whether they want a count of all orders or a rupee amount. Ask which statuses should count. Ask which dates are in scope. A useful formula begins when the question specifies the result and the input rows clearly enough that another person could do the work by hand.
Write the result and its unit
Sum of amounts, count of rows and average minutes are different summaries. Write the label in a nearby cell before writing the formula. “Pune delivered amount (₹)” states what rows qualify and what value was combined. That label also gives you something to check when a zero or unusually large value appears. “Recent total” would require the reader to find out whether it refers to all orders on the sheet or a particular range of dates.
Choose the row test and the value
For Pune delivered amount, the row test reads City and Status. The values being added come from Amount. Use =SUMIFS(G2:G11,C2:C11,"Pune",I2:I11,"Delivered"). The first argument is the range to sum. Excel then reads range-and-criterion pairs. A criterion is a condition such as a status equaling Delivered. The formula checks C and I for each row and adds the G value from matching rows.
For delivered orders above the minutes limit, use =COUNTIFS(I2:I11,"Delivered",H2:H11,">12"). The minutes criterion is written as text here because it contains an operator and a number that together describe the test. There is no separate sum range. Each matching order contributes one to the count, regardless of whether it took fourteen minutes or eighteen.
Read the formula beside a real row
Follow row 4. C4 says Pune, I4 says Delivered and G4 holds 110. It passes both conditions in the sum. H4 holds fourteen, so it also passes the minutes test. Now follow row 10. C10 says Pune, but I10 says Cancelled. This row contributes to neither conditional answer. H10 is thirteen; it meets the minutes criterion on its own, which proves why the status condition is needed.
Pick a family by the shape of the answer
It is easier to remember functions if you first know which kind of task you are doing. Start with a desired result, then choose the smallest operation that gets you there. Here are the six decisions you will make repeatedly as this chapter grows.
Combine values across rows
Use SUM for a numeric total, COUNT for the number of numeric entries, and AVERAGE for the arithmetic mean. The mean divides the sum of numeric values by their count. In the delivered minutes example, seven numeric times add to ninety-four. Divide by seven to get about 13.43 minutes. For a real service report, decide upfront how to handle missing or invalid durations. A blank record and a recorded zero have different meanings. The latter is eligible for a numeric average. A plain Excel average over a range skips genuinely empty cells.
Use criteria to define the valid rows
Use the conditional summary functions when the question contains words such as “for Pune,” “Delivered only” or “over twelve.” The plural versions take multiple conditions, and those conditions must all hold for the same row. You can also ask for the shortest or longest numeric value within a group. For the delivered orders here, the observed smallest time is eight minutes and the largest is eighteen. If there were no delivered rows for a particular city, check the matching-record count before interpreting a minimum, maximum or average. No observed time has a different meaning from a recorded time of zero.
Read and assemble labels
Text functions help you take pieces out of IDs, clean extra characters and build consistent output labels. In AMN-1003, the platform prefix comes before the hyphen. You could take the first three characters when you know every prefix is three characters long. You could use a delimiter-aware function when prefixes vary in length. A delimiter is the separator character between pieces of text. Think about which property your input actually guarantees before choosing between fixed position and a delimiter.
Work with actual dates and times
Messages often bring dates as text that looks familiar to a human. Excel date calculations need dates it can use as values. Verify the start and end values before trying to compute age, shifts or elapsed time. A chart label reading “3 November” can be text, while the calculation uses a true date in another cell. The chapter covers calendar dates, working days and elapsed time separately, because each answers a distinct question.
Apply a rule to each row
Use IF when the result changes depending on a test. For the order report, you can combine IF with AND to say that a row is ready for review when its status is Delivered and its minutes are greater than twelve. The formula gives a text label for every order it evaluates. This layout is useful when colleagues need to filter the source and inspect the actual orders behind a summary.
Diagnose errors and combine arrays for a reason
Later lessons introduce ways to respond to errors and combine matching arrays, which are groups of values Excel can calculate with together. An error is information about what Excel found while evaluating a formula. Investigate it before choosing a fallback label. Some summaries are clearer with criteria functions. A product of paired quantities and unit prices calls for multiplication within rows before addition across rows, a task that a function such as SUMPRODUCT can express.
Lab 1 · Answer the shift team's report questions
Work from the full ten-order sheet above. Use a spare area to the right and add one descriptive label for each result. Each formula below uses the indicated ranges on Orders. If you move the report to another worksheet later, you will need sheet-qualified references or another well-defined way to identify the data.
Establish the totals that act as controls
- Use
=COUNTA(A2:A11)to check that all ten expected IDs are present. Here each ID cell is meant to hold text. This check counts populated cells. A duplicate ID could still produce ten, so count alone cannot prove uniqueness. Compare the identifiers against the source list if you spot a repeated record. - Use
=SUM(G2:G11)to find the gross listed amount. It is ₹2,870. Gross here means the values written on all ten practice rows, regardless of status. Label it that way before adding a delivery-only result. - Use
=COUNTIF(I2:I11,"Delivered")to count seven delivered order rows. Look down the status column and confirm that only two rows are Cancelled and one is Returned. The categories cover all ten records and their counts add up. - Use
=SUMIF(I2:I11,"Delivered",G2:G11)to find the delivered amount of ₹2,215. Ask yourself how it differs from gross. The cancelled rows contribute 240 and 220, and the returned row contributes 195. Subtracting the 655 total of those three amounts from 2,870 independently gives 2,215.
Apply two conditions and audit the row numbers
- Enter
=SUMIFS(G2:G11,C2:C11,"Pune",I2:I11,"Delivered"). Expected result is ₹324. Verify it with rows 2, 4 and 7. Their amounts are 64, 110 and 150. - Enter
=COUNTIFS(I2:I11,"Delivered",H2:H11,">12"). Expected result is four. The matching rows are 4, 6, 8 and 11, with minute values 14, 16, 18 and 17. - Try
=COUNTIF(H2:H11,">12")separately. It returns five because it includes row 10. This larger count has a clear explanation. The omitted status condition changed the set of rows. - Temporarily replace the operator in the two-condition count with greater than or equal to. The delivered count rises from four to five because Nashik row 3 has exactly twelve minutes. Restore the strict test for the remaining lab.
With a longer source sheet you may rely on a filter or a separate list of matched rows to verify a number. On a ten-row fixture, count and add the selected rows directly. You should be able to say exactly which ID appeared or disappeared when you changed a condition. This also checks that your criteria ranges begin and end on the same record boundaries.
Lab 2 · Write a review label and test changes
Return to the original data. In J1, type Review flag. In J2 enter =IF(AND(I2="Delivered",H2>12),"Review","No review"). The equals sign inside the first test compares the text in I2 with Delivered. The greater-than symbol compares H2 with twelve. AND returns TRUE only when both tests hold. IF chooses the first label for a true result and the second label for a false result.
- Read J2 on the original dataset. It should show No review. The row is delivered, but nine minutes fails the strict time test. A single true condition is insufficient.
- Fill the formula down through J11. J4 and J11 should show Review. J3 should show No review at exactly twelve. J10 should also show No review, since the cancelled status fails the first condition even though the time exceeds twelve.
- Use
=COUNTIF(J2:J11,"Review")outside the data and compare the four labels with the conditional count from Lab 1. You checked the same policy using two forms. One returns one label per row. The other counts matches without the help of a flag column. - Predict three results before editing. Change I10 from Cancelled to Delivered. Gross should stay at ₹2,870 because no amount changed. Pune delivered amount should rise to ₹544 because row 10 now qualifies. The delivered-over-twelve count and Review count should each rise to five because row 10 took thirteen minutes.
- Verify J10 now displays Review, then restore I10 to Cancelled. Recheck the original readings. Reversible input changes help show whether a worksheet is reacting to the data or simply displaying an answer somebody typed earlier.
Step through row 10 when its status changes
Read the original record
Row 10 is Pune, amount ₹220, elapsed minutes thirteen, and cancelled. The amount counts in the gross total regardless of status.
Check the baseline rules
The status excludes the order from both the Pune delivered sum and the delivered-over-twelve count. The time by itself would allow a review label, but the combined rule rejects the row.
Apply one change
Change the status field to Delivered. The order now qualifies for the city sum and time count. Its amount, city and minutes have the same values as before.
Reconcile the outputs
The sum gains ₹220 and the count gains one. The label becomes Review. Restore Cancelled and verify that all three readings return to the original answers.
If the sheet does not update, select the suspect result and inspect the formula bar. Confirm it starts with an equals sign and has the expected references. Inspect the edited row's status for spelling or pasted whitespace. If the formula and value are right, confirm the workbook has recalculated. Manual calculation and pasted static values can make a correct-looking sheet lag a real edit.
Check that the result says what you think it says
A formula can look tidy, return a number, and still answer a different question from the one a team asked. Use the order sheet to build habits for checking a calculation before you add more functions. The smallest effective check is a row with a known outcome plus a small change that should affect only one part of your report.
Start by identifying the included rows
Write down row 4 as a case that should match, row 3 as a boundary case, and row 10 as a case that should fail on status. Look for a fourth example in another city so that you know the city criterion matters. Row 8 is delivered and has a long time. It belongs to the late delivered count, and its Solapur city keeps it out of the Pune sum. These examples separate the two questions even though both use Delivered.
Distinguish a real zero from an empty input
Suppose H4 is cleared by mistake. That leaves an unrecorded duration. Suppose instead that someone types zero. That supplies a numeric value. Either one fails the simple “greater than twelve” test for this numeric example, but the two rows have different meanings for the team that owns the data. An average can include the numeric zero and omit the genuinely empty cell. If a business rule must show “Missing time” first, design that branch deliberately and test it before interpreting the results.
Give each formula an independent proof
- For a sum, identify the exact amounts from the qualifying rows and add them without using the original formula. The Pune sum proof is 64 plus 110 plus 150.
- For a count, identify the record IDs that passed. Confirm that each passing row contributed one. The order report compares that count with a separate count of the generated review labels.
- For text, examine the exact returned characters. Spaces and leading zeros can be meaningful. Check the result in a new cell alongside the original string.
- For a date or time, inspect the source type and choose known dates with an easily reasoned difference. Include a midnight or weekend boundary when it matters to the question.
- For a rule, check an example from every possible result. A good test includes one row at the threshold and one row that fails another condition.
Find the layer where a mistake started
When a calculation fails, first locate the sheet and cell that hold the result. Look at the formula bar to distinguish the entered expression from the displayed value. Then follow the formula back to its inputs. Once you know whether the defect lives in the calculation, selection or source value, the repair can be specific.
- Excel displays formula characters. If a single expression appears as text, check whether it was entered into a Text-formatted cell or has a leading apostrophe. If many cells suddenly show formulas, check the Show Formulas setting. These are different workbook states, so inspect before retyping everything.
- A formula includes the wrong rows. Read the first and last addresses aloud.
G2:G11excludes row 12. If you later add rows, verify whether your summary is supposed to cover them. Excel Tables are one way to have a reference follow intentionally growing data. A fixed demonstration range remains useful for a controlled fixture. - A filter seems to disagree with the displayed summary. Many normal range summaries still act on all cells in the reference after you hide rows with a filter. Treat a filter as a way to inspect the data. Choose a function designed for visible or filtered values if that is the report requirement, and verify its behavior with one hidden row.
- A number looks too low. Check whether every amount or time is numeric. Pick an input and use a small independent formula such as
=ISNUMBER(G2)or compare COUNT against the expected population. A correctly written addition formula cannot rescue a source value that arrived as the wrong type. - A new status text fails silently. A pasted value might contain a leading space or a different spelling. Check the contents and agree on the list of status labels before writing a more complicated formula. Text cleanup later in this chapter gives you tools to make such inputs consistent.
Error results give another clue. An invalid reference, a missing name and an impossible division point toward different problems. In a practice budget, division by a zero quantity is useful evidence that the source needs attention or the rule needs a zero-quantity case. Turning that error into a reassuring zero would change what a person understands about the data. The later error lessons separate deliberate outputs from data repairs.
Follow the chapter in working order
If you are new to spreadsheets, begin with the Excel Basics lesson on relative and absolute references and practise predicting what happens when an expression moves. Review the differences between workbooks and sheets, and between a stored value and a display format, whenever a copied result is confusing. The formulas in this chapter use both ideas repeatedly.
Build numbers you can reconcile
- Formula basics and operators covers the equals sign, arithmetic, comparisons, references and calculation order. Read it first if the parentheses in a discount formula feel unfamiliar.
- SUM, SUMIF and SUMIFS moves from a plain total to a sum over exactly the records that satisfy your conditions.
- The COUNT family distinguishes numeric cells, occupied cells, blank results and conditional counts. Check one cell with each type so you know what each counter observes.
- Averages and conditional extremes asks which values are eligible and how many you have before you interpret a mean, minimum or maximum.
- ROUND and RANK separates rounding a real value from simply displaying fewer decimals, then asks what a tie means in an ordered report.
Take apart or assemble text
- LEFT, RIGHT, MID, LEN, FIND and SEARCH lets you read and locate characters without guessing how Excel numbers them.
- SUBSTITUTE, REPLACE, TRIM, CLEAN and case uses the smallest transformation that corrects the intended characters.
- Joining text and controlling its display builds reusable labels with a delimiter and makes deliberate decisions about dates or numeric placeholders.
- TEXTBEFORE, TEXTAFTER and TEXTSPLIT reads each piece by its separator. Check what your Excel version supports and how the result behaves when one formula returns multiple cells.
Calculate with dates and business rules
- Date functions covers the current date and time, controlled date creation and month boundaries.
- Working days and date differences chooses a calendar, weekend policy and end-point behavior before using a formula.
- Time calculations works through elapsed values, overnight cases and formats for longer durations.
- IF, nested IF and IFS connects each outcome to a tested condition.
- AND, OR, NOT and SWITCH develops conditions and the order in which rules are tested.
- IFERROR and IFNA chooses how to surface expected gaps and unexpected problems.
- SUMPRODUCT combines values in corresponding positions and then adds the individual products.
- Error types and repairs follows each reported error to the first faulty input or expression.
Use the practice and answer key after you can explain the row filter used in the two labs above. A natural next step is to learn to look up values from another table and use Excel Tables to make a summary follow new rows. Advanced dynamic array work, more complex wildcard criteria, and careful multi-source data cleaning build on this chapter. Start with a controlled small dataset and add those behaviors when they solve a real problem in it.
Leave a small test plan with the finished report
When you share a workbook, someone else will open it without hearing your explanation. Put the expected readings and any assumptions close to the report. In this practice case, the relevant assumptions are that a row represents an order, Amount is in rupees, and a review requires Delivered status and more than twelve numeric minutes. State that the seven delivered rows form the baseline against which you checked the results.
Include an independent hand check from the ten inputs. For the time example, the seven delivered durations add to ninety-four minutes. Taking all ten would include 11, 10 and 13 from other statuses and give 128 minutes. The mean would become 12.80 instead of about 13.43. An average can get smaller when you add data, so a larger row population does not guarantee a larger average. Label the population so the two results can be interpreted.
The next reader should also know what to do as the list grows. This page deliberately uses a ten-row exercise. A future report may use a Table and structured references so rows added as table records are included. Compare an appended test order whose amount and status you know before relying on the live summary. Keep a fixed copy of the ten-row fixture so you still have a quick place to check that a formula change preserves the original results.
Quiz · decide what Excel should return
Which rows belong to Pune delivered amount: 2, 4 and 7, or 2, 4, 7 and 10?
Use 2, 4 and 7. Row 10 passes the city condition and fails the status condition. Its amount helps explain the difference between the ₹544 all-status Pune total and the ₹324 delivered Pune total.
Does a twelve-minute delivered order pass the “more than twelve” rule?
No. Twelve equals twelve. The greater-than comparison requires a larger number. Making the rule inclusive adds the delivered order on row 3 to the baseline late count.
Should delivered count return seven, or ₹2,215?
It should return seven. A count adds one per eligible order. ₹2,215 is the amount total from the same seven rows, which belongs on a separately labeled line.
Which result must stay unchanged when only row 10's status changes?
Gross amount stays ₹2,870. It adds every G value regardless of status, and no amount changed. Both conditional measures can move because the rule now includes that row.
Do an unrecorded time and a numeric zero affect AVERAGE the same way?
An actual empty cell is skipped in a range-based average. A numeric zero is part of the calculation. Decide which entry you have before interpreting a number or comparing it against a target.
What would make the row-label count and the COUNTIFS summary useful as a cross-check?
Give both formulas the same statuses, numeric tests and row population. Then compare their results and inspect the actual labels. A count of four could match by chance if one intended row was skipped and another was added, so trace the matching IDs on a practice fixture.
Interview practice · explain the reasoning aloud
How do a formula and a function relate?
A formula is the expression Excel evaluates. A function is a built-in calculation you can use inside that expression. I can add two amount cells using the plus operator, or I can use SUM to total a range. I would show the range explicitly so it is clear which cells count.
How do you choose between SUMIFS and COUNTIFS?
First I write the answer's unit. For Pune delivered sales in rupees, I add the amounts from rows meeting both tests with SUMIFS. For the number of delivered orders above a time limit, I count matching records with COUNTIFS. The conditions define the population and the function determines how it is summarized.
How would you verify a conditional summary before sharing it?
I would select a small, known dataset, identify the included records myself and compare the independent result. I would also modify one predictable row in a test copy. Changing the status of a ₹220 delivered-eligible Pune order should change the Pune total by ₹220 while leaving gross unchanged.
When would a row-level label help alongside a count?
It helps when a colleague needs to act on individual records. I can count late delivered orders for a headline and attach labels so the team can find those precise rows. I would count the labels and compare them with the original summary to check the two rules agree.
What would you check when a conditional summary suddenly drops to zero?
I would look for a known row that should match, check that each referenced range includes it, then verify the status and numeric types on that row. Zero can be a valid result. A controlled row makes it possible to distinguish that situation from a reference or source problem.
Six cards to revisit before the next lesson
- Formula and function An expression starts with equals. An expression can use operators directly or ask a function to calculate with its arguments.
- Row and field One row here is one order. A field such as city or amount gives one piece of information about each order.
- Match and combine Define which orders qualify. Then decide whether the result is an amount, number of orders, average or another unit.
- Boundary test Twelve fails greater than twelve. It passes greater than or equal to twelve. Give both versions a row where you expect the outcomes to differ.
- Label as evidence A per-row decision makes the summary easier to audit. Find the accepted IDs and compare the label count with the report.
- One reversible edit Change one input in a copy. Predict the formulas that should respond, compare the results, and restore the original value.
The original print cards remain available for download. Save the conditional summary card, logic card or text and date card. These older illustrations use their own small example data.