Skip to main content

Sum a cell through several Worksheets



You have 12 identical worksheets, one for each month. You would like to summarize each worksheet. Is there a better way than using =Jan ! B4 + Feb! B4+Mar! B4+Apr! B4…?

Solution: You can use a 3-D formula such as =SUM(Jan:Dec!B4), as shown in Figure 41.

Figure 41. A 3-D formula adds up all instances of B4 on the 12 sheets from Jan through Dec.

Figure 41. A 3-D formula adds up all instances of B4 on the 12 sheets from Jan through Dec.

Late-breaking Tip: To add up cell B4 on all the worksheets with Sales in the sheet name, type =SUM(‘*Sales’!B4) and press Enter.

If the first or last worksheet contains a space in the name, you have to use apostrophes around the pair of worksheet names: =SUM(‘Jan 2009: Dec 2009’!B4).

You can easily copy this formula to other cells on the summary worksheet. Gotcha: Do not drag the summary worksheet to appear after the Jan worksheet, or you will set up a circular reference.

Additional Details: It is possible to set up a named range that refers to a 3-D range. Here is an interesting way to set up a named range:

  1. Go to cell B4 on the Jan worksheet.
  2. Select Insert, Name, Define.
  3. The Refers To box contains =Jan!B4. Click in the box. Hold down the Shift key. Click on the Dec worksheet. The Refers To box changes to =Jan:Dec!B4.

Comments

Popular posts from this blog

20 Time Intelligence Dax Measures

20 Time Intelligence DAX measures in Power BI with examples: Year-to-Date Sales: css Copy code YTD Sales = TOTALYTD( [Total Sales] , Calendar [Date] ) Month-to-Date Sales: css Copy code MTD Sales = TOTALMTD( [Total Sales] , Calendar [Date] ) Quarter-to-Date Sales: css Copy code QTD Sales = TOTALQTD( [Total Sales] , Calendar [Date] ) Previous Year Sales: mathematica Copy code Previous Year Sales = CALCULATE ( [ Total Sales ] , SAMEPERIODLASTYEAR ( Calendar [ Date ] ) ) Year-over-Year Growth: css Copy code YoY Growth = DIVIDE( [Total Sales] - [Previous Year Sales] , [Previous Year Sales] ) Rolling 3-Month Average Sales: sql Copy code 3 M Rolling Avg Sales = AVERAGEX(DATESINPERIOD(Calendar[ Date ], MAX (Calendar[ Date ]), -3 , MONTH ), [Total Sales]) Cumulative Sales: scss Copy code Cumulative Sales = SUMX (FILTER(ALL(Calendar), Calendar [Date] <= MAX (Calendar[Date])), [Total Sales] ) Running Total Sales: scss Copy code Running Total Sales = SUMX (FILTER(ALL(Calendar), Calen...

40 Power Query Editor features in Power BI

40 Power Query Editor features in Power BI along with examples: 1. Filter Rows: Remove rows based on conditions. Example: Remove rows with a null value in the "CustomerName" column. 2. Remove Duplicates: Eliminate duplicate rows. Example: Remove duplicate entries based on the "OrderID" column. 3. Sort Rows: Arrange rows in ascending or descending order. Example: Sort data by "Date" column in descending order. 4. Replace Values: Substitute one value with another. Example: Replace "N/A" with "Unknown" in the "Status" column. 5. Split Columns: Divide a column into multiple columns. Example: Split "FullName" into "FirstName" and "LastName." 6. Merge Queries: Combine data from multiple sources. Example: Merge customer and order data based on the "CustomerID." 7. Group By: Aggregate data based on a specific column. Example: Group sales data by "ProductCategory" and calculate the sum ...