Ravindra BagaleCourses & study guides मराठी Track your progress

26. Excel Tricks Every Analyst Should Know

26.7 Table, Sorting and PivotTable Tricks

Example first. A total should follow the filter, cities should sort in business order, a PivotTable should show shares, and daily dates should roll up into months. Four tricks.

Trick 25. A Total Row that follows your filter is shown in the box below; tricks 26–28 follow it.

Total Row with SUBTOTAL — in 30 seconds

What: The Table Total Row uses SUBTOTAL(109,…), which adds only visible rows.

Why: A normal SUM below a filtered list still adds hidden rows; the Total Row always matches what you see.

Tiny example: No filter: ₹2,870. City = Pune: ₹544. City = Solapur: ₹1,299.

First look at the data (before → after):

Total Row with SUBTOTAL: before and after tables, fictional Blinkit Maharashtra data

Expected result — After Table Design › Total Row

Filter Total Row (₹)
None 2870
City = Pune 544
City = Solapur 1299
Before table and formula as text

Before — Orders Table, no total

Rows Total
10 orders —

Formula / click path

Total Row: =SUBTOTAL(109,[Amount])

Do it step by step:

  1. Click inside the Table, tick Table Design › Table Style Options › Total Row.
  2. In the total cell under Amount choose Sum from the list. Excel writes =SUBTOTAL(109,[Amount]).
  3. Filter City: the total shows only the visible rows.

Trick 26. Sort in your own order, not A to Z

Before:

City
Kolhapur
Nagpur
Nashik
Pune
Sambhaji Nagar
Solapur

After:

City
Pune
Nashik
Nagpur
Kolhapur
Solapur
Sambhaji Nagar

Steps:

  1. Click Data › Sort & Filter › Sort.
  2. Sort by City, Order: Custom List….
  3. Type Pune, Nashik, Nagpur, Kolhapur, Solapur, Sambhaji Nagar, click Add, then OK twice.
  4. The list is saved and can be reused in any file on this computer.

Trick 27. Show each city as a percent of the total in a PivotTable

Before:

City Sum of Amount (₹)
Pune 544
Nashik 360
Nagpur 240
Kolhapur 232
Solapur 1299
Sambhaji Nagar 195
Grand Total 2870

After:

City % of total
Pune 19.0%
Nashik 12.5%
Nagpur 8.4%
Kolhapur 8.1%
Solapur 45.3%
Sambhaji Nagar 6.8%
Grand Total 100.0%

Steps:

  1. Right-click any value in the PivotTable.
  2. Choose Show Values As › % of Grand Total.
  3. Tip: add Amount a second time to show rupees and percent side by side.

Trick 28. Group daily dates into months in a PivotTable

Before:

Date Sum of Amount (₹)
03-10-2026 128
05-10-2026 180
11-10-2026 195
… …

After:

Month Sum of Amount (₹)
Oct 1005
Nov 1310
Grand Total 2315

Steps:

  1. Right-click any date in the Rows area and choose Group….
  2. Select Months (and Years if the data covers more than one year), click OK.
  3. Daily rows collapse into months. (Data: the 12 orders from 24.1.)

Practice task (try it before you open the answer):

  1. Sort cities as Pune, Nashik, Nagpur, Kolhapur, Solapur, Sambhaji Nagar.
  2. Show Pune as a percent of total in a PivotTable.
  3. Group the 12 Power Pivot orders by month.
Answer

Data › Sort › Order: Custom List. Pune = 19.0% of ₹2,870. Grouped: Oct ₹1,005, Nov ₹1,310.

Ravindra Bagale's Tip

In a PivotTable, show rupees and percent together: drag Amount into Values twice and set the second one to % of Grand Total. A percent alone hides the size.

Loading practice tasks...

  1. Distinct groups (Easy): How many different values in B2:B11?
  2. List groups (Easy): Unique list of B2:B11.
  3. Filter names (Easy): Names in A2:A11 where B is "Google".
  4. Sum of filtered (Medium): Sum of D2:D11 where B is "Meta", using FILTER.
  5. Count filtered (Medium): Rows where D is above the average of D2:D11.
  6. Sorted values (Medium): D2:D11 sorted largest first.
  7. Top value via SORT (Medium): The largest E2:E11 value using SORT and INDEX.
  8. Second largest (Hard): Second largest D2:D11 using SORT and INDEX.
  9. Numbers 1 to 5 (Hard): A spill of numbers 1 to 5.
  10. Two-condition filter (Hard): Sum of D2:D11 where B is "Google" or "Meta".
  11. Names joined (Hard): Names where B is "Google", joined with ", ".