7. PivotTables and PivotCharts
7.10 GETPIVOTDATA
Give a dashboard cell a named question. GETPIVOTDATA can ask for Pune's FreshGo amount from a particular PivotTable. Sorting the report can move the result to another row. The formula keeps asking for the same value while it remains available in the report.
When the right number leaves its original cell
Priya builds a one-page practice report from five delivery records. A blue card above the report shows ₹434 for Pune's FreshGo orders. She wired the card to the cell that held ₹434. A teammate reorders the cities by total recorded amount, and the card's source cell now holds Nashik's ₹150. Nothing looks broken. The displayed number is valid for another city.
GETPIVOTDATA is an Excel worksheet function that retrieves a value from a PivotTable by identifying its value field and optional field-item pairs. It carries the report identity and the question together. “Amount for City Pune and Platform FreshGo” is still the same question after rows are sorted. The result may change when the source updates, a report filter changes, or a required detail is no longer displayed.
Connect it to a useful output
- A KPI card: A dashboard card often lives in a fixed place with a specific label, such as “Pune FreshGo amount.” Its definition should remain meaningful when a report builder sorts rows.
- A print-ready table: A summary might use fixed headings and a custom order. Keep the flexible PivotTable for analysis, and use named questions to populate the cells of the separately formatted report.
- An auditable check: A formula can request the current report total, alongside a separately calculated source control. A mismatch can point to an active filter, an older PivotTable result or different source logic.
This page uses fictional delivery records. FreshGo and QuickCart are fictional practice labels in the first lab. The second contains synthetic orders using Blinkit and Amazon Now as platform labels. A recorded order amount is the Amount value in the teaching data, and the Delivered view uses only that status.
Read the formula in three blocks
=GETPIVOTDATA("Amount",$A$3,"City","Pune","Platform","FreshGo")
- Value field
"Amount". Ask for the data field shown in the Values area. With only one Sum of Amount present, the underlying name Amount is enough in this example. Microsoft documents using the displayed name or its root where appropriate. If you have multiple calculations from Amount, capture or use the exact displayed value-field caption for the calculation you intend. - Report anchor
$A$3. Point to a cell inside the target PivotTable. If it occupies A3 through D7, its top-left cell is a convenient stable choice. If your report starts elsewhere, use an actual cell inside your report. The dollar signs keep the reference anchored during normal formula copying. - Field-item pairs.
"City","Pune"identifies the field and its item."Platform","FreshGo"adds a second condition. The requested intersection is the amount for Pune and FreshGo under the report's current scope.
A field name describes a column and an item names a choice
City and Platform are field names. Pune and FreshGo are items in those fields. The worksheet might display a shared heading like Row Labels because of the selected layout. Inspect the field list or click a known value to discover the actual field name. If your data source calls the city field Delivery City, a formula that names City needs adjustment. Keep the exact spelling from the report instead of matching a report title you typed independently.
Text names go inside quotes when typed as literals. A cell reference uses no quotes. Compare "Pune", which always asks for the word Pune, with $H$2, which reads whatever item is entered in H2. Writing "$H$2" asks for the literal text made of those four characters with dollar signs. Start with a known literal so you can confirm the anchor works. Substitute the input cell after the simple version returns the expected value.
Lock the right reference for the right reason
The second argument selects the report. Absolute references like $A$3 prevent Excel shifting that argument as you copy a formula. They do not guarantee a different or relocated PivotTable will always occupy A3. If you rebuild the report elsewhere, verify this reference. A stale anchor can even read from a different report if your copy points into another valid PivotTable with the same field names.
When the formula lives on another sheet, qualify the anchor. =GETPIVOTDATA("Amount",ByCity!$A$3,"City",$A6,"Platform",B$5) points to the PivotTable on ByCity and uses local heading cells on the dashboard. If you copy across a custom grid, $A6 keeps the city input in column A while moving row by row. B$5 keeps the platform heading in row 5 while moving across columns. The PivotTable anchor stays fixed. Start by testing two known intersections before filling the grid.
Keep a single inside cell as the anchor. Microsoft documents a special selection rule for a range containing multiple PivotTables. With a single anchor within the intended report, the dependency is easier to inspect and explain. Use an output cell clear of the report's potential expansion area, or use a separate dashboard sheet.
Choose the level of detail you want back
Omitting an item asks for a broader visible total
The first fixture has two Pune FreshGo orders, ₹300 and ₹134, and one Pune QuickCart order, ₹200. The intersection with both filters is ₹434. If you request Pune without naming a platform, you are asking for its broader total under the report's current scope. With both platforms shown this is ₹634. If you name neither dimension, the formula asks for the report's visible total. The original unfiltered fixture totals ₹1,034.
| Question | Formula with anchor in A3 | Result, unfiltered |
|---|---|---|
| Pune and FreshGo | =GETPIVOTDATA("Amount",$A$3,"City","Pune","Platform","FreshGo") | ₹434 |
| Pune, all shown platforms | =GETPIVOTDATA("Amount",$A$3,"City","Pune") | ₹634 |
| Nashik, all shown platforms | =GETPIVOTDATA("Amount",$A$3,"City","Nashik") | ₹400 |
| Grand total of this report | =GETPIVOTDATA("Amount",$A$3) | ₹1,034 |
If the report hides QuickCart through a platform filter in this ordinary local example, the Pune amount under that report's new visible scope is ₹434. Calling the card “Pune, shown platforms” makes that dependency clear. If the activity requires Pune's total across all source records regardless of report filters, design that metric separately and specify its conditions. A separate unfiltered PivotTable or a worksheet calculation with its own criteria can serve that purpose.
Recognize the value definition as well as the item
Sum of Amount answers how much recorded amount accumulated. Count of Amount answers how many source rows have a nonempty Amount entry in that context. In the first fixture the answer for Pune FreshGo can be ₹434 as a sum or two as a count. If both calculations sit on a report, generate sample formulas by clicking the exact cells. Meaningful report captions such as Total order amount and Amount entries help a reviewer check which calculation the card reads.
Check custom value displays too. If the displayed field uses a percentage such as % of Grand Total, its visible result is from that calculation rather than a standalone money amount. Click the correct cell and apply the desired display on the output. A ratio displayed as 0.42 and 42% can represent the same underlying value. Compare scale and definition before correcting a formula that appears to have changed units.
Use the correct kind of item for numbers and dates
Names such as Pune use quotes. A numeric item can be supplied as a number or drawn from a cell containing a number. For an actual ungrouped date item, Microsoft recommends providing a date serial value or using DATE so the meaning survives locale differences. DATE(2026,11,2) explicitly describes 2 November 2026. A typed string such as "02/11/2026" can be read differently under another date convention or fail to match the PivotTable item.
If your PivotTable groups dates, the displayed field might be Years or Months instead of the individual Date item you expected. Inspect the generated formula from the relevant row and match the actual visible grouping. For a multi-year report, define both year and month where the visible layout supports it. A card for November across the wrong years can be a bigger problem than an obvious error. The second lab uses ungrouped dates to isolate the role of the exact date argument.
Trace a value before and after a sort
Read the target intersection
Find City Pune and the FreshGo platform column. The two original amounts add to ₹434. Remember the row position for this test.
Generate the named question
Type an equals sign in an empty output cell and click the ₹434 value. Inspect the anchor and the two field-item pairs. If Excel generates a cell address instead, type the function manually using your valid report anchor.
Sort by the city total
In city-name order, Nashik comes before Pune. Sorting by descending Grand Total places Pune first at ₹634, ahead of Nashik at ₹400. A formula returning the original physical slot can now show Nashik.
Compare the question and its availability
The named formula still shows ₹434 after the sort. Then hide Pune with the City filter and check the response. Sort changes where a visible answer sits. A filter can remove the answer from the report's view.
Lab 1 · Keep a city card correct when the PivotTable moves a row
Prerequisites. Use a blank practice workbook. Create a sheet called Source and type the five rows below into an Excel Table or a clean single-header range. Create a PivotTable from that local source on a second sheet called ByCity. Start it at A3 if your build allows that placement. If it starts somewhere else, substitute a verified inside cell in all examples. Type numeric amounts and use no currency text in the input.
| City | Platform | Amount |
|---|---|---|
| Pune | FreshGo | 300 |
| Pune | QuickCart | 200 |
| Nashik | FreshGo | 150 |
| Nashik | QuickCart | 250 |
| Pune | FreshGo | 134 |
- Place City in Rows, Platform in Columns, and Amount in Values. Check Sum of Amount. Keep grand totals visible and clear initial filters. FreshGo total is ₹584, QuickCart total is ₹450 and the grand total is ₹1,034.
- Sort City labels A to Z initially. Verify Nashik appears first at ₹400 and Pune second at ₹634. Note the address of the FreshGo value in the Pune row. Keep the same platform column order during both sorts.
- In a safe area, such as H3, type an equals sign and select the ₹434 data cell. If your Excel generates GETPIVOTDATA, inspect the expression. It should reference the intended PivotTable and identify both City and Platform. If needed, build it by typing the documented function with your own valid anchor.
- In H4, type a direct reference to the original address manually to force the comparison formula. For example, if your result is in B6, type
=B6. Start with both outputs equal to ₹434. - Sort the displayed city rows by the Grand Total values descending. On desktop Excel you can generally right-click a suitable numeric grand total and choose the descending sort option. Confirm Pune is now first and Nashik second. The old address in the FreshGo column now displays ₹150. The GETPIVOTDATA output is still ₹434.
- Type Pune in H1 and use
=GETPIVOTDATA("Amount",$A$3,"City",$H$1)beside your test cells. It should show ₹634. Switch H1 to Nashik and check ₹400. A Data Validation list with those exact two city names can help future users choose a recognized item. - Ask for the report total with
=GETPIVOTDATA("Amount",$A$3). Confirm ₹1,034. Filter the City field to Nashik only. The grand total in this local setup becomes ₹400, and a separate named formula for Pune FreshGo returns#REF!because Pune is hidden. Restore both cities and retest ₹434.
Troubleshoot and finish. If the direct address remains ₹434 after the sort, inspect whether rows really swapped and whether you accidentally generated another GETPIVOTDATA formula. If the named result fails before any filtering, check the inside anchor, field names and current layout. Save the scratch workbook with both cities available and the formulas labeled. You should be able to explain the difference without memorizing B6.
Lab 2 · Separate a real zero from a hidden result
Prerequisites. Make a second scratch workbook using the six fictional rows below. Name the source Table tblDaily and use the exact headings, including Date and Status. Enter dates as actual Excel dates, for example by typing =DATE(2026,11,2) for 2 Nov 2026. Type the order amount zero as numeric 0. The table gives it an actual Cancelled record so it represents a known entry in the source.
| OrderID | Date | City | Platform | Status | Amount |
|---|---|---|---|---|---|
| BLK-4101 | 2 Nov 2026 | Pune | Blinkit | Delivered | 64 |
| BLK-4102 | 2 Nov 2026 | Pune | Blinkit | Cancelled | 0 |
| BLK-4103 | 2 Nov 2026 | Nashik | Blinkit | Delivered | 270 |
| AMN-4104 | 3 Nov 2026 | Pune | Amazon Now | Delivered | 110 |
| BLK-4105 | 4 Nov 2026 | Pune | Blinkit | Cancelled | 220 |
| BLK-4106 | 8 Nov 2026 | Nashik | Blinkit | Delivered | 90 |
- Place a local PivotTable on a sheet called Daily at A3 or note a different inside anchor. Put Date in Rows, City in Columns, Status in Filters and Sum of Amount in Values. If Excel creates automatic date groups, ungroup them using the applicable desktop command, or start from a report showing the individual Date items. Ensure you can see dates such as 2 Nov and 4 Nov individually. After adding the report filter, verify A3 still lies inside the target report, or substitute your actual inside anchor.
- With all statuses shown, verify the grand total ₹754 and 2 November total ₹334. Pune totals ₹394 and Nashik totals ₹360. For a clean local demonstration keep “show items with no data” off if you enabled it in another exercise. Leave empty combination display on its usual blank setting.
- In a safe cell, query Pune on 2 November with
=GETPIVOTDATA("Amount",$A$3,"Date",DATE(2026,11,2),"City","Pune"). It returns ₹64 for all statuses. The actual rows are ₹64 and ₹0. Leave the formula in place for the filter test. - Select Cancelled in the Status report filter. The visible Pune cell on 2 November returns numeric 0. The grand total is ₹220. Check the source has one Cancelled row for that date and city, rather than an empty combination formatted with a zero.
- Switch the Report Filter to Delivered. The same 2 November Pune formula returns ₹64 again. Query 4 November Pune using
DATE(2026,11,4)with the same other arguments. The date item has no visible Delivered value in this fixture, so the request returns#REF!. Clear the filter and confirm the original ₹220 for the date and city. - Outside the report change a copy of the formula to a known blank cell as its anchor, such as Y1. The result is also
#REF!. Restore the correct anchor and leave the report with all statuses before saving.
Troubleshoot and finish. If you cannot query a date visible in the sheet, click the date's number with the generate option enabled to inspect the actual field and item. Entering a displayed short date as text can differ from supplying the underlying date value. Confirm the correct report and filter before touching the formula. Record the three distinct outcomes: 0 for the known numeric row in scope, a hidden report item and a broken anchor. Both error cases require diagnostic context.
Explain an error before choosing its display
Walk down the dependency chain
- Identify the PivotTable. Navigate to the anchor and click it. Check that the contextual PivotTable controls appear and that you are in the intended report. If you rebuilt the layout on a different sheet, confirm the sheet part of the formula.
- Test the value field. Start with
=GETPIVOTDATA("Amount",$A$3)or the correct caption for your report. See whether its result agrees with the visible total. If it fails here, adding more item pairs won't repair that dependency. - Check one item at a time. Add City Pune and compare against the visible city total. Then add Platform or Date. A failure after one pair identifies the field or item whose availability you should examine.
- Inspect the report's current filters and layout. Look for a slicer, timeline or report filter. Check the relevant row and column. Collapsing or reorganizing a layout can remove the display detail your formula asks for. Verify the item under the current view before treating it as absent from your source.
- Check the data's current version. If a new item is visible in the source and you expected it in the report, confirm the source extent and refresh path. An item outside a fixed range will remain unavailable even if its name matches exactly.
Decide whether the card tracks the report or the whole source
For a card titled “Shown Pune amount,” the live report is the source of truth. If Pune is filtered out, displaying “Check report view” or a clear unavailable state can help the viewer diagnose the mismatch. Using IFERROR with a fallback message can improve presentation after you verify the underlying formula in a separate debug cell. Since it catches different errors, do not call its fallback “no orders” based on the wrapper alone.
For a card that always asks “How much was recorded for Pune on 4 November, only Delivered?” a source-table calculation can specify those criteria regardless of the PivotTable's active report filter. For the lab source use =SUMIFS(tblDaily[Amount],tblDaily[City],"Pune",tblDaily[Date],DATE(2026,11,4),tblDaily[Status],"Delivered"). It yields 0. Pair it with a COUNTIFS using the same non-amount criteria. That count is 0 here, indicating no matching source row. For 2 November and Cancelled, the sum is still 0, but the count is 1. The explicit count lets the report distinguish those two facts.
Use the independent check for troubleshooting too. Suppose Status is set to Delivered and you want the unfiltered source's ₹220 Cancelled amount for 4 November. A row check sees the Cancelled record; the GETPIVOTDATA request under the Delivered view cannot retrieve it. Both results can be consistent. Choose whether to adjust the filter or to publish the separate established metric based on the dashboard's purpose.
Give the person receiving the workbook a way to verify it
Put an inspectable label next to the card: “Pune FreshGo, shown report scope.” In a multiple-status workbook, show or state the status filter as well. If a manager expects a figure across every date, don't put the same label on a report currently filtered to a single week. Note which worksheet owns the anchor. Make a simple check cell summarizing the unfiltered source as a comparison, then leave it clearly labeled.
Before sharing, sort the report and run one deliberately incompatible filter, then restore the normal view. If a hidden result can occur during ordinary use, plan its reader-visible display. Test a numeric value, a numeric zero if present, and an unavailable field-item combination. A dashboard that responds predictably in these three cases is easier to review and maintain.
Build a fixed report that can survive normal changes
Make a two-by-two summary for a reader
Use the first lab's PivotTable and add a sheet called Summary. Set A5 to City, B5 to FreshGo, and C5 to QuickCart. Set A6 to Pune and A7 to Nashik. Keep these labels visible next to the outputs. They give the formula its criteria and give the human reader a way to check exactly what each cell means. In B6, enter the cross-sheet formula from earlier with an anchor verified inside ByCity.
- Check B6 returns ₹434 before filling. The local input is A6, the platform comes from B5, and the anchor refers to ByCity. Distinguish the output sheet's grid from the separate PivotTable that provides its values.
- Copy B6 across to C6. Look at the new formula and confirm it uses the same city label and C5 for QuickCart. Expect ₹200. If it moved the city reference right, use the dollar sign before A.
- Copy the first row of formulas down to row 7. Confirm the copied expressions use A7, and the platform references remain on row 5. Expect Nashik FreshGo ₹150 and Nashik QuickCart ₹250. If both city rows repeat Pune, check whether you locked the city row by mistake.
- Calculate the sum of the four cells to verify ₹1,034 in the initial fully displayed view. Check the PivotTable's visible grand total independently. Keep the check outside the report area so an expanded PivotTable has room.
- Swap the visible city label inputs A6 and A7. The two results for each row should follow its new city label when the report includes both cities. This proves the grid depends on its labels. Then restore Pune above Nashik.
- Return to ByCity and sort it by a different field without removing required detail. The print sheet should keep its own order. Hide QuickCart and inspect the resulting status of each card. Re-enable QuickCart before saving the full view.
The grid turns the structure of the sheet into part of the contract. When a report builder later copies its cells into a one-column card, related heading references should be adjusted deliberately. If the PivotTable is expanded with a new platform, the custom grid still has two explicit columns. That can be by design, but is a different scope than “all platforms.” Before sharing a grouped total from the four cells, confirm whether all expected platforms are represented here.
Verify independence with two named reports instead of one ambiguous reference
Suppose a dashboard must show both total recorded order amount and current Delivered amount. Build two clear reports from the second lab's rows. Give one report all statuses and the other a local Delivered filter. Use separate anchor locations, and label cards as “All recorded order amount” and “Delivered order amount.” For the six lab records, the all-status report returns ₹754 and the Delivered report returns ₹534. Their difference, ₹220, is the sum of the two Cancelled amounts, including a numeric zero.
Test that each reference is intentional. Change the Delivered report's filter briefly to Cancelled. Its visible total becomes ₹220. The all-status figure should remain ₹754 if your filters and controls were deliberately independent. Restore Delivered after the test. This shows that the data can be identical and still answer two different questions. A copied formula pointing to the wrong anchor can return a valid-looking ₹754 where the manager expects ₹534.
If you decide the two cards should follow a shared City slicer, check the report connections and test once. With Pune selected, the all-status result is ₹394 and Delivered is ₹174. With Nashik selected, both show ₹360 because all Nashik records in the fixture are Delivered. Pune is the stronger connection test because it separates the expected values. Use a revealing case before trusting the dashboard in production.
Check what can change when a report builder reviews the workbook
Sorting the PivotTable, relocating it, renaming a value field and removing a dimension are different operations. Sorting changes where the visible points appear. Relocating or rebuilding may change where the anchor must point. Renaming can change the caption a formula requests. Removing a dimension can make values at that level unavailable. Record which edits you test, and make a copy before changing the shape of a report someone already relies on.
To separate layout from data, change one thing at a time on the copy. First sort and verify the emitted query. Then open the field list and confirm the data fields and item detail still exist. Finally refresh updated input and compare source controls. If all these changes happen before a user checks the card, one valid-looking number can hide the step that changed its meaning.
A named dashboard question can be a good dependency when a team already relies on a PivotTable's aggregation, filters or custom calculations. If the only requirement is a small independent value with explicitly defined source criteria, a worksheet summary may be simpler. Check business rules before choosing a data route. In the same file, it is reasonable to have an interactive card that follows the current pivots and a separately labeled independent reconciliation total.
Test a new and renamed item before distributing the sheet
Imagine FreshGo starts appearing as FreshGo Express in the next practice export. An old report or output formula can still ask for FreshGo. If the text now means a new platform item, rename the heading the formula reads only after establishing the mapping. If both items exist, a label that merges them needs its own explicit aggregation policy. A direct cell address could silently show whichever entry happens to be in its old column.
On a scratch copy, add a new ₹25 Pune FreshGo line to the first fixture and refresh the report after checking its actual source. Freeze expected amounts first. Pune FreshGo becomes ₹459, Pune all platforms ₹659 and the all-city total ₹1,059. Nashik stays ₹400. If the matrix still returns the original values, it may be faithfully querying a stale report. Addition, label change and filtering are distinct reasons an answer can differ from yesterday.
Use a simple last check before an interview or handoff. Say the question out loud, point at the report anchor and then identify the visible cell answering it. Add a single known new row or run a sort to show which references should remain stable. In a report with many copies of one value field, reconcile one of the exact calculations, such as sum and count for the same city, instead of assuming they use the same caption.
Keep totals and individual points in the same denominator
A custom grid often shows a share next to its amount. For the five-row fixture, try calculating Pune's share for FreshGo as the amount for Pune and FreshGo divided by the total for FreshGo across both cities. The denominator is ₹584, so the result is about 74.32%. It answers “what portion of FreshGo's current recorded amount is from Pune?” If you divide by the entire report's ₹1,034 instead, the result is about 41.97%. Both percentages use the same ₹434 numerator and answer different questions.
- Start with the full five-row local report. Query the selected intersection, the platform total for FreshGo and the report total in three cells. Give each an explicit label before choosing a denominator.
- Filter the report to Pune and recheck the visible FreshGo total. It is now ₹434. A share from the same visible scope becomes 100% for Pune within FreshGo. If the card is supposed to show the unfiltered two-city share, use a separately established denominator and name that broader population.
- Restore both cities. If you compare with a PivotTable percentage calculation, confirm it is configured as the same type of percentage and under the same filters. For a one-city card, note which filters are allowed to change the denominator.
At a quick project review, two useful readouts are “₹434 from Pune FreshGo” and “74.32% of FreshGo across both cities.” If someone changes the slicer, the figure may change for a valid reason. Display a clear active filter near where the resulting metric is read. If a zero denominator is possible, define what “share unavailable” means in your report before building a guard formula. Ensure an error caused by a missing anchor or field can still be identified independently.
For a formula copied to later sheets, test one source row and one percentage under a deliberately different filter. A repeated direct position can look right for the first displayed row. The change is what verifies its dependency.
Inspect the generation setting versus an existing formula
The Generate GetPivotData command controls how a sheet reference is written when you click a PivotTable result during formula entry in supported Excel builds. It is not required to type the function manually. Look at the formula bar to see what was actually entered.
Check the direction of a relative reference
Copy the B6 formula to C7. It should still point into ByCity at the same anchor, then use city A7 and platform C5. Absolute references preserve the fixed report anchor while mixed references move along the participating labels.
Inspect a cross-sheet anchor with spaces in its worksheet name
If the sheet is called By City, a typed reference can be 'By City'!$A$3. Clicking the appropriate report during formula creation lets Excel construct the sheet part of the reference. Open the named sheet and verify the anchor remains inside the PivotTable.
Compare a visible zero and a truly unknown value
A typed 0 with one matching Cancelled row is a known value in our prepared workbook. A report request that fails because its anchor is wrong does not answer the data question. Keep the availability message explicit.
Quick quiz with explanations
1. What does the second argument in GETPIVOTDATA identify?
A. The title of the KPI card. B. A reference inside the target PivotTable. C. The order amount to retrieve.
B. It identifies the report to ask. The resulting value can be elsewhere in that report.
2. Which formula pair asks for the city selected in H1?
A. "City","H1". B. "City",$H$1. C. $H$1,"City".
B. City is the field name. The unquoted cell reference supplies the item such as Pune or Nashik.
3. The five-row report is sorted by Grand Total. What happens to the named Pune FreshGo amount?
A. It stays ₹434, while that intersection remains visible. B. It becomes ₹150 because the old row changes. C. It becomes ₹634.
A. The function follows the field-item question. ₹634 requests a broader Pune total.
4. A hidden item returns #REF! and a blank anchor also returns #REF!. Is zero a proven answer?
A. Yes for the hidden item. B. Yes for both. C. The error alone proves neither value is zero.
C. Check report scope and anchor validity. A measured zero needs independent evidence such as the one matching Cancelled row in Lab 2.
5. What value should you use for a specific ungrouped Excel date?
A. A date value such as DATE(2026,11,2). B. The name of the worksheet. C. The literal text “latest.”
A. An actual Excel date value identifies that date item. A locale-dependent text date can fail or refer to the wrong day.
6. What is the total of the four fixed summary cells with both city and platform items shown?
A. ₹754. B. ₹1,034. C. ₹634.
B. ₹434 + ₹200 + ₹150 + ₹250 equals the grand total for that five-row report.
Interview questions and example answers
- Why use GETPIVOTDATA instead of linking to a cell address?
- The output needs an amount for a named set of dimensions. If the pivot sorts, the address can point to the same physical slot even when the record order changes. The named query keeps asking for Pune FreshGo as long as the report can supply it.
- How would you build a formula that takes both a city and a platform as inputs?
- I first generate or type a known formula with literal labels and verify it against the report. Then I replace the items with references, keeping field names as text. In a grid I use mixed references to its visible row and column labels.
- What will you check first when a dashboard returns #REF!?
- Verify the second argument is inside the intended PivotTable. Test a simple data-field request, then add one pair at a time. Check the item names, filters and visible detail before changing a formula that once returned the correct value.
- Can the worksheet formula ignore the active report's filters?
- GETPIVOTDATA retrieves values available from its target report. If the dashboard needs a fixed independent question, I make a separately scoped summary or another PivotTable and label that source explicitly.
- What if there are two calculations for Amount in Values?
- I click the exact result I want to capture its correct naming. I use meaningful distinct captions and validate both sum and count against known examples. For the fictional Pune FreshGo rows the amount is ₹434 but the populated amount entry count is two.
- How would you show a hidden value to a nontechnical reader?
- I would inspect the unwrapped error first, then use a clear unavailable state where the card can legitimately fall outside the selected scope. I would avoid replacing every error with zero because a broken anchor could look like a valid measured result.
Revision cards
- Value field The calculation to retrieve. Check the displayed caption when a source field appears more than once.
- Anchor One cell inside the intended PivotTable, typically locked for copying. Verify it after a rebuild.
- Field-item pair Pick the named field and a particular item. The combination narrows the question.
- Visible scope Filters and the report's current levels determine the values that can be requested.
- Zero versus unavailable Verify a real numeric zero. Treat #REF! as a prompt to check anchor, field and item.
- Two validation states Sort available results to test position independence, then filter out a target to test the unavailable path.