Sum specific values in the Grand Total row of a Pivot Table - excel

Many thanks for your help in advance. I need help finding a way to sum specific values in the Grand Total row of a Pivot Table based on the corresponding column label. The challenge is that the row that the Grand Total is in isn't fixed, meaning in one instance the Grand Total may be in row 9, then after data addition/removal, it will be in a different row. Also, multiple columns match the criteria.
The attached image show what the Pivot Table looks like. I2 and J2 show the output I need regardless of which row the Grand Totals are in.

Credit to #DavidLead for pointing me in the right direction. The three screenshots attached to this answer are a supplement to the guide for using the GETPIVOTDATA formula in excel. I am using Excel 365.
In the first screenshot, you will see the raw data reformatted to have our columns, i.e. Name, B, A, and Month. Cell N2 shows the total/sum for A. in January and the formula is shown in the second screen capture, Cell O2 shows the sum/total for A. for all months combined. The formula is also shown in the second screenshot.
Regardless, you will see in the formulas for N2 and O2 that I reference the cell $G$1. This tells the formula which pivot table to look for the "A.". Then in the third position of the formula, I reference the Pivot field list column name "Month", and in the third position, I specify "January".
The formula can return 1 to 126 pairs of field names and item names that describe the data that you want to retrieve. In my case, I could have retrieved the total for John in January or for all months.
For example,
Total for John in January
=GETPIVOTDATA("A.",$G$1,"Month","January", "Names","John")
Total for John, January thru March
=GETPIVOTDATA("A.",$G$1,"Month","January", "Names","John")+GETPIVOTDATA("A.",$G$1,"Month","February", "Names","John")+GETPIVOTDATA("A.",$G$1,"Month","March", "Names","John")
The benefit of this formula is that if the Grand Total row changes I will always get the sum of A. and/or B. for all months. It is dynamic and is what I needed to accomplish.
Formula Explanation
`=GETPIVOTDATA("A.",$G$1,"Month","January")`
"A." = the column that has the data I need
$G$1 = the reference to the Pivot Table (Microsoft's
knowledge article states this can a reference to any cell, range of
cells, or named range of cells in a PivotTable. This information is
used to determine which PivotTable contains the data that you want to
retrieve.)
"Month" = the column I need
"January" = the name of the row for the total I need
To get the total for "A." from January thru March, I use the following formula:
=GETPIVOTDATA("A.",$G$1,"Month","January")+GETPIVOTDATA("A.",$G$1,"Month","February")+GETPIVOTDATA("A.",$G$1,"Month","March")
The most important factor of this formula is that you reference a cell in your pivot table. In my case, I used $G$1. I also tried other cells in the pivot table as reference cells, and the formula returned the correct values.
I hope this helps the next person who needs a similar solution and finds this answer. Please give this a vote if it helped you.
1st Screenshot
2nd Screenshot
3rd Screenshot

Related

Trying to reference data in variable rows after matching specific cell in excel

In Excel I'm trying to paste in weekly time card reports and then reference the bottom line of each section which contains the yellow highlighted text string in column B (report contains 15-20 sections with variable row differences).
Without using VBA, is there a way to identify an employee ID (Column A), then calculate how many rows below that ID that the last text string cell is located in column B (Highlighted in yellow in the example). Then use that row difference to offset the INDEX formula to grab correct row from the table.
I was using INDEX/MATCH to find the employee ID and then trying to offset the row return per employee manually when I realized that the different job codes rendered that formula inaccurate.
I had used this to reference the proper columns with the offset for one of the weeks, but each week varies. The "+17" at the end of the below formula is where I need the variable row difference to grab the yellow highlighted cell.
=INDEX($A$1:$A$100,(MATCH(A61,$B1:$B$100,0)+17))
Thanks in advance, hopefully I provided the right info to answer the question if there is a solution!
after a revamp of the thought process, the following formula will return the information corresponding to as specific employee and their tax information which is stored in column B in a cell with "EFURTA" in it. No other cell in B within the employee block can contain "EFURTA". If that happens only the first occurence will be returned.
Assuming your data is layed out per the image below, the following formula will return the information you are looking for:
=INDEX(B:B,AGGREGATE(15,6,ROW($A$1:$A$80)/((FIND("ERFUTA",$B$1:$B$80)>0)*(ROW($A$1:$A$80)>MATCH(D2,$A$1:$A$80,0))),1))
Adjust the ranges to suit your data.
If you just want the row number, just grab the aggregate part of the formula and drop the index.

Specifying range criteria without the use of a structured table

I am working on a table that holds the total amount for products sold or bought in the total column with a reference column that refers to the product id which the total points to.
I need to mark of those products for which the total amount (debit/received) calculates to 0 for each product reference.
For this, I am currently using structured table references to specify the range in my SUMIFS formula like this
=ROUND(SUMIFS([Total],[Reference],[#Reference]),2)=0
Could you please help with how to do the same using the range instead of table references as in
=ROUND(SUMIFS(AD:AD,AC:AC, ..............),2)=0
Please help me on how to write the formula in this case.
You need to enter this at a given row, say row 2:
=ROUND(SUMIFS(AD:AD,AC:AC,AC2),2)=0
' ^^^ The row you type in
and then copy/paste in the cells below; the row number will automatically adjust for each row.

How to conditional format with multiple criteria (Excel Pivot table)

I have an Excel pivot table with no set boundaries (boundaries depend on what slicer option the user select).
In Column A: I have the store information such as daily sales volume and other value information. Since there are countless stores, this information repeats for each store. Sales_Volume column is placed in the VALUES section area in PivotTable Fields (Along with other columns that are also placed in the VALUES section, but I am only concerned with Sales_Volume column).
In Column B - xxx: I have the daily dates in the COLUMNS section area in PivotTable Fields so starting from Column B contains the Sales_Volume information for that day (Along with other values,but I am only concerned with Sales_Volume column). Every 9th row starting from row 13 contains the Sales_Volume value for that day.
What I want is for the conditional formatting to search for the the word "Sales_Volume" in Column A and for that Row color the cell red for any values in that row that are less than 200.
Does that makes sense? So ONLY every 9th row starting from row 13 would contain the conditional formatting (if the values are less than 200 in those specific rows only).
Any help would GREATLY appreciated!!
Perhaps a helper column could work for you...create another column with the formula of =AND(A1="Sales_Volume",B1<200). This would either return TRUE or FALSE, and you could conditionally format that column.
I found the solution if anyone is interested:
I used the same formula listed here: "=AND(B6<200, $A6="Sales_Volume")"
however, my fix came from selecting the entire workbook from the first row that I wanted the conditional formatting to be set on so my selected range was:
B6 - XFD1048576 and voila!

Excel: Combine =vlookup and =countif

For my question I am trying to reduce a very large amount of data using the =countif function in regards to a specific Employee ID (using =vlookup).
In Column 'A' I have every employee ID listed only once. In columns B, C, D, E, and F I would like to count every time that employee has been Hired, Promoted, received a Pay Increase, been Demoted and Fired, respectively.
In Column 'I,' I have again a list of employee ID's and in 'J' each time one of those actions were implemented.
Since there are more than 10,000 employee iterations that exist in column 'I' this is why I am trying to condense these down to numeric values in columns B:F.
ACTUAL QUESTION: Is there anyway to 'nest' these two functions in order to get the required results that I want?
Thanks in advance.
You can use Countifs with multiple conditions (not Countif, which takes only one condition)
Consider the following screenshot. The formula in cell B2 is
=COUNTIFS($I:$I,$A2,$J:$J,B$1)
Copy across and down. Note the position of the $ signs. They are important. The column references for columns I and J are absolute, and will not change when the formula is copied across. The reference to $A2 will always refer to column A, but the row will adjust when copied down. The reference to B$1 will always refer to row 1, but the column will adjust when the formula is copied across.
You can do a similar thing without any formulas at all, using a pivot table. Click a cell anywhere in the data in columns I or J, then click Insert > Pivot Table. In the pivot table pane that appears on the right, drag the Employee ID to the Rows area, drag the action to the Columns area and drag either of the fields to the Values area. The result looks like this:
Look Ma, no formulas!!

Excel Report - Excel Formulas

I am trying to formulate my data on a report in order to return the sum of items from column C based on the same item on column A and column B. For example:
http://i.stack.imgur.com/FadW7.png (I can't post the image because I don't have 10 reputation yet T.T)
On the above image, User "A" has used a Sum of data for "z1". I need to automatically grab a list of users per zones and sum the data for that user and that zone.
I have elementary experience with Excel (I can add formulas but I do not know what formula to write), any help would be greatly appreciated.
Regards,
You can use SUMIFS:
=SUMIFS($C$1:$C$16,$A$1:$A$16,"a",$B$1:$B$16,"z1")
(COLUMN TO SUM, COLUMN WITH 1ST CRITERIA, 1ST CRITERIA, COLUMN WITH 2ND CRITERIA, 2ND CRITERIA)
or
=SUMIFS($C$1:$C$16,$A$1:$A$16,G1,$B$1:$B$16,G2)
where Cells G1 and G2 are the user and zone respectively.
You'll also need to change the range of the cells in the columns.

Resources