Extract Pivot Table Row Label (not value) - excel

In Excel 2010, I have a pivot table, in compact form, with 3 Row Labels (that represent a management hierarchy). Which of the 3 management levels is displayed in a particular row will change from day to day. (The source data is on another spreadsheet with the fields Manager L3, Manager L2 and Manager L1 in columns with John Smith, Gary Glen and Bob Stevens under them, respectively.)
In the column next to the pivot table, I need to capture which row label is being shown.
Pivot Table example
Is there a formula I can use to produce that info?
Let me know if you need more information. Thank you in advance.

Like I said above, I believe your solution would be to create an array on another (hidden) sheet like:
Then run a VLOOKUP to it: =VLOOKUP(A45,Sheet1!$A$1:$B$6,2,FALSE)
You'd put that formula in cell B45 on your sheet and drag down.

Related

Excel Adjacent Formula

I am desperately trying to find a formula that solves my problem.
Sheet1 structure:
name date weight
John 31.07.2020 80
Jack 01.08.2020 75
...
Sheet2 structure:
date John Jack ....
31.07.2020
01.08.2020
What I need to do is, for every date and name combination in Sheet2, I need to copy the weight information from Sheet1 into name's column of Sheet 2.
Example outcome:
date John Jack ....
31.07.2020 80
01.08.2020 75
I have used a couple of formulas but I could not make it work.
Can you help me with this?
Thank you
First, turn your data entry table into an Excel Table object by using Ctrl-T or Insert > Table.
Then, with one cell of that table selected, use Insert > Pivot Table.
Drag the Date into the Rows area, drag the Name into the Columns area and the Weight into the Values area. Format the pivot table to have no grand totals (Design Ribbon visible when a cell in the pivot table is selected).
When you add new data to the data entry table, the Table object will expand automatically and you can simply refresh the pivot table to include the new data.
It's really quite simple with SUMIFS.
If Sheet 1 looks like this:
...then you use this formula:
=SUMIFS(Sheet1!$C$2:$C$3,Sheet1!$A$2:$A$3,Sheet2!B$1,Sheet1!$B$2:$B$3,Sheet2!$A2)
=SUMIFS(Sheet1!R2C3:R3C3,Sheet1!R2C1:R3C1,Sheet2!R1C,Sheet1!R2C2:R3C2,Sheet2!RC1)
=SUMIFS(Table1[weight],Table1[name],Sheet2!B$1,Table1[date],[#date])
=SUMIFS(Table1[weight],Table1[name],Sheet2!R1C,Table1[date],[#date])
I get this:

How to keep data together in excel

i have a spreadsheet in excel 2016 that uses the following formulae
=IFERROR(INDEX(Attending!$A$2:$A$20,AGGREGATE(15,6,(ROW($A$2:$A$20)-ROW($A$2)+1)/(Attending!$B$2:$B$20="Yes"),ROW(1:1))),"")
This formula takes names in column A of the attending sheet and if column be against those names is set to "Yes" they show in the menu choices sheet.
but it only adds entries into column A of menu choices sheet
so then in the destination sheet entries against these peoples name in columns B, C and D get out of wack of someone else gets added above them.
how do I link a given persons B, C and D data to them so they stay in alignment when new entries are added in above them.?
Also when menu choices B1 has a value greater than empty I want attending sheets C1 to be set to a value of "Yes".
how do I do these things?
From the sample worksheet you provided, I can see that you have switched the columns as suggested. After checking the workbook, I think you should also add the Deposit column on the Menu Sheet and manually update the column on that sheet.
So presume you have filled out the Menu table as below:
Enter the following formula in Cell B2 in your Attending table, and drag it across to Column D and drag it down to the end of the table.
=IFERROR(IF(VLOOKUP($A2,Table2,COLUMN()+1,0)>0,"Yes","No"),"")
And enter the following formula in Cell G2 in the Attending table, and drag it down to the end of the table.
=IFERROR(VLOOKUP(A2,Table2,6,0),"")
Please note Table2 in the above formulas are the name for the table on your Menu sheet. Please replace it with the actual table name if needed.
Once done, you should have the following on Attending sheet:
Let's say later on you need to update the Menu table for AMC as below:
Your Attending table should be updated automatically as below:
---------------- EDIT #2 ----------------
As requested, I have changed Column F on the Menu Table to Amount Paid instead of Deposit, which allows the user to input the actual dollar value paid instead of the word Paid/Unpaid.
Then replace the formula in Cell G2 and H2 on the Attending Table as below, and drag them down to the last row of the table.
=IFERROR(VLOOKUP(A2,Table2,6,0),"")
=IF([#[Price:]]="","",F2-G2)
Then you should have the Amount Paid and Balance to Pay showing correctly on the Attending Table. It may not be necessary to maintain a separate column showing whether a fixed deposit is paid or not as long as it is not mandatory to pay a fixed amount up front.
Conclusion, it is A good practice to keep all manually updated data in one place, and keep all formula-driven data in another. Do not mix them up so you will not encounter the problem of hard-coded data entry does not match with formula-driven result.

How to automate a spreadsheet so that changing a value in one cell allows that entire row to appear in a separate tab of the worksheet?

Say I have a spreadsheet, as shown below:
Is there some kind of tool, add-in or formula, that would allow me to take all of the rows that are in 'July', and put them in a table in a separate tab:
In such a way that if I changed say 'COA' (the first row in the first picture) from January to July, it would automatically update the separate table to include this?
(Or at least be updateable with a click of a button or by refreshing)
My boss has asked me to see if this is possible, and I have no idea of how to go about it.
Thanks
It is possible.
In order to extract multiple items from a list you can use the INDEX function with SMALL to create an array formula.
Try the formula below. It assumes that the first column is A and column F contains the months.
=IFERROR(INDEX($A$2:$F$300,SMALL(IF(($F$2:$F$300="July"),ROW($A$2:$F$300)-1),ROW(1:1)),1),"")
IMPORTANT: use CTRL+SHIFT+ENTER when entering this formula to make it an array formula. You then need to auto fill down to get all the July records. This formula pulls data from column 1 (that's the last 1 in the formula). If your code in column 1 is unique to each row you can use a VLOOKUP to get the other columns. If it's not then you can copy the formula to the next column. And change the 1 at the end to 2..3 etc.
Instead of putting July in the formula you can reference a cell that contains July and then duplicate the sheet and change the cell to August or simply change the cell whenever you like to see data for different months.
It's not an easy formula to follow but it does work.
You could try doing a Pivot table with all the columns expect month in the rows section, using tabular view, no subtotals, and repeat item labels. Then put month in the filter section. Then you can update the pivot table by right click refresh or by clicking the refresh all on the data tab

Excel Formula to mark X if two values are found

I have a spreadsheet that lists pieces of equipment with columns for the type of equipment and their city location etc. Each region (made up of multiple cities) has a sheet for all of their equipment.
I am trying to set up a sheet that summarizes which equipment is located in which city.
I have been trying to set up a formula that will look at Sheet2 and the column for location and the column for the equipment type and if the city matches say Adelaide and also matches Bench Shears then mark with an X.
I have tried using a =IF(ISNA(VLOOKUP formula but I can only get it to work with one variable and not 2.
Any help or suggestions would be greatly appreciated!!
Each region (made up of multiple cities) has a sheet for all of their equipment.
That does not sound like good data architecture. As the golden rule, all your data input should be in ONE sheet. Then you can build reports on that data on other sheets.
With the info you provide above, it looks like a better data structure might be a sheet with a table. The table would have columns for Region, City, Equipment Type.
This is a flat, two-dimensional table. Each piece of equipment goes into its own row. No blank rows, no blank columns. Use Excel's Table feature to make this a table with Ctrl-T.
Now you can create a pivot table. Click a cell in the data table and then Insert ribbon > Pivot table. Drag Region into the Rows area, drag City into the rows area, drag Equipment Type into the rows area and again into the Values area.
This is a simplified example. If you need more help to get this to work, please edit your question and post a sample file.
Are you trying to make a table of the listed values in sheet2, such that cities will be listed in a column and equipment listed in a row, with an x appearing in a cell where the city and equipmnt exist? If so then add a third column to your data in sheet 2:
=A1&B1
for all values in the list, then lookup the two values in each cell in you tabulated data in sheet 1:
=IF(ISNA(VLOOKUP($A2&B$1...
and use this in all the cells in the table. The dollar signs mean that the column $A and row $1 will not change when you copy the formula across the table.
You need to get all of the data from each region in a single list...

Excel/PivotTable: Is there any way to prevent the cells from moving when I filter information?

My current pivot table contains 4 columns: time in Column A, then Zone 1 in Column B, Zone 2 in Column C, and Zone 3 in Column D.
Is there any way to "lock" the columns, e.g. if I apply filter by Zone and only select Zone 3, Zone 3 will stay in Column D?
Currently, if I filter by Zone and only select Zone 3, Zone 1 and Zone 2's column disappear and Zone 3 will then be in Column B.
Thanks for any help you can provide.
I'm going to say "No". Pivot tables are a world to themselves inside of Excel.
You may have noticed that if you do something that expands them into surrounding data, they don't shift that data, they just warn you. Similarly, if you have formulas that refer to certain columns in a pivot table, filtering the pivot table as you've done doesn't adjust the cell reference as it does when you add or delete regular columns. I assume this is the type of issue you're seeing.
If so, consider using the GetPivotData function, which allows you to refer to pivot table columns.
Below I've shown how this could work with a simple table. The GetPivotData formula uses a variable (an added bonus!) in cell F1. In this case it gives you the overall total for fiona:
=GETPIVOTDATA("value",$E$4,"name",F1)
Note that when I filter to just "fiona" it still works:
Note that you can make the formula as specific as the data in the pivot table. Here I get the sales for doug on Thursday. (I could use variables for both "doug" and "Thursday" here as well:
=GETPIVOTDATA("value",$E$4,"day","Thursday","name","doug")
The easiest way to create a GetPivotData formula is to type "=" in a cell and then click in the pivot table cell you are interested in. You can then edit from there.
Here's a great Contextures GetPivotData tutorial.
Yes, here is how:
1-Go to the column values you want to prevent from collapsing.
E.g.: Field Settings menu
2-On Field Settings, select the 'Layout & Print' tab, then check the 'Show Items with No Data' checkbox.
E.g.: Show Items with No Data option
This should prevent, say, your column D data from moving to the spreadsheet column A data whenever the columns to the left of D do not have any value for the filter/slicer settings.

Resources