Excel Pivot Advanced How to incorporate multiple columns - excel

I have a table that looks like this -
Key | X | Y | Z
| Date | Date | Date
1a | 01-Jan-16 | 15-Jan-16 |
2a | | 01-Feb-16 |
3a | | | 01-Mar-16
I need to do a pivot on this table, to get a resulting table that looks like this -
Key | Type | Date
1a | X | 01-Jan-16
1a | Y | 15-Jan-16
2a | Y | 01-Feb-16
3a | Z | 01-Mar-16
I've tried multiple versions of Pivot, but they don't get me all the data within these 3 columns. What might the best solution be?

Delete the row with Date. Insert copies of your Key column immediately to the left of your Y and Z columns. Add two adjacent columns at a time using Multiple consolidation ranges, drill-down on the Grand Total intercept and filter the Value column to delete rows with blank cells. Label as appropriate.

Related

Excel function, exclude dates in chart data source

I am forming a chart from sheet A. Sheet B contains all my data.
I want to exclude a specified date(s).
Sample data:
+---+----------+--------------+--------------+-------------+-------------+-------------+
| | A | B | C | D | E | F |
+---+----------+--------------+--------------+-------------+-------------+-------------+
| 1 | Date | 29/03/2017 | 30/03/2017 | 31/03/2017 | 03/04/2017 | 04/04/2017 |
| 2 | Number 1 | -594590.4649 | -636666.4504 | 795637.1614 | 842563.4322 | 496463.9301 |
| 3 | Number 2 | 2189587.44 | 1301681.418 | 2080839.353 | 1945335.214 | 2421728.123 |
+---+----------+--------------+--------------+-------------+-------------+-------------+
The final output would be me excluding 30/03/2017 , and keeping the rest in my data selected for my chart.
the issue is that I want to maybe exclude a date in the middle of my selected range. But since this may be a hassle to input a long formula each time into my data selected. I would like to see if there is any formula/function to eliminate a specified date/column. Perhaps manually enter the column you want to exclude in a formula.
My current range is something like =Graph!$AB$5:$KA$7 But is there a function to exclude one of these columns?
I can manually select which dates with Ctrl but seems tedious.

How to refer to values in a structured reference column from the top of the column using a formula on a different row

I have realised that structured references are clean to write when making formulas, however when using them in a formula to refer to values in columns using structured references this only returns the values on the same row as your formula. This is not ideal.
Is there a way to refer to values in a structured reference column from the top of the column with a formula on a different row? I looked into this answer but it was only for the top value in the column.
So for example say I have a Table1 with 3 data columns and then I want to make a Table2 with a calculation column that is as simple as =Table1[Data1]*Table1[Data2], how would I get that formula to work down the column of Table2 even if Table2 is not on the same rows as Table1?
| Data1 | Data2 | Data3 |
|------------------------
| 22 | 7 | Joe |
| 24 | 2 | Bob |
| 44 | 7 | Ben |
| 29 | 8 | Sue |
| Calc1 |
|----------
| Formula | (Formula = 22 x 7)
| Formula | (Formula = 24 x 2)
| Formula | (Formula = 44 x 7)
| Formula | (Formula = 29 x 8)
Edit just so readers understand, this is an oversimplification of what I am trying to achieve, managing to use structured references as stated above will help solve the bigger problem.

Excel Formatting issues

I am about 1500 data split into for different cells. I am trying to join them when I do that the zero value before the number isn't getting added.
Say for example:
| B | C | D | E |
1| 90 | B8 | 6C | 04 |
and all the cells are in number format.
I do the following: E1&D1&C1&B1 I get the results like 46CB890 instead of 046CB890. I can add a zero to the value but there are 1500 data and I don't how many have this issue. How to solve this? so that I get 0 while joining the values.
Thanks!
Change the format of all the cells to text (fill E1 with 04).
Re-use the formula and it should work.

Can I use COUNTIF function with or in GETPIVOTDATA?

I have a pivot table something like this...
Duration
Run#| Product A | Product B | Product C |
01 | 2:01:00 | | 2:45:00 |
02 | 2:02:00 | | 2:45:00 |
03 | | 2:04:00 | 2:45:00 |
04 | 2:03:00 | 2:02:00 | 2:45:00 |
...
SUM | 6:06:00 | 4:06:00 | 11:00:00 |
I would like to use use GETPIVOTDATA to find an average of the times in the pivot table (not the source data)
So, my averages would be...
Product A | Product B | Product C |
2:02:00 | 2:03:00 | 2:45:00 |
Can accomplish that with GETPIVOTDATA? If so, how?
If not, is there another function available?
I have already built the average in a 2nd table using the Sum and a "count" function but it uses table references (i.e., COUNT(B4:B49)) which are a bit clunky since my pivot table will grow over time as more "runs" are completed (past row 49 which is the row of the latest run).
Something like this will grow with the Table:
=AVERAGE(B4:INDEX(B:B,MATCH(1E+99,B:B)-1))
It basically finds the range starting in B4 to the last row with number minus one so it does not include the total.

Extract data from two tables to summary report based on primary key

I have two Excel sheets, one called plan and other one called sewing data. I want to extract data from sewing data sheet to a summary report. Both sheet contain primary key and some data comes from plan sheet and others come from sewing data.
Sample data:
[plan]
ID | Style | SO | QTY
---+-------+-------+------
1 | a | 20050 | 100
2 | b | 20051 | 100
[sewing data]
ID | Day1in | Day1out | Day2in | Day2out | Day3in | Day3out
---+--------+---------+--------+---------+--------+-----------
1 | 20 | | 10 | 25 | |
2 | | | 50 | | |
2 | | | | | 50 | 70
1 | | | | | 70 | 75
And my output should be like:
[summery report]
ID | Style | SO | Qty | Day1in | Day1out | Day2in |Day2out|Day3in| Day3out
---+-------+------+-----+--------+---------+--------+-------+------+-----------
1 | a |20050 |100 | 20 | | 10 | 25 | 70 | 75
2 | b |20051 |100 | | | 50 | | 50 | 70
On the [plan] sheet, create a named range 'plandata' to cover the plan
data
On the [sewing data] sheet, add 3 columns, headed Style, SO, Qty, with
formulas
=vlookup(A2, plandata, 2, false)
=vlookup(A2, plandata, 3, false)
=vlookup(A2, plandata, 4, false)
respectively (here A2 is the reference to the ID cell, plandata is the named range from the [plan] sheet you created in step 1, numbers 2/3/4 are the column numbers you need for the lookup, i.e. Style, SO, and Qty, and false means exact match for the lookup).
Copy these formulas down the entire [sewing data] sheet
Select any cell in [sewing data], then Insert > Pivot Table (select 'new worksheet')
In the Pivot Table wizard, drag ID, Style. SO and Qty as row labels,
and Day1In..Day3Out as ∑ values.
You can create a one-size-fits-all formula by wrapping the first VLOOKUP function in an IFERROR function which passes control over to a second SUMPRODUCT function if the VLOOKUP cannot find the column header label in the first. In B15 as,
=IFERROR(VLOOKUP($A15, $A$3:$D$4, MATCH(B$14, $A$2:$D$2, 0), FALSE), SUMPRODUCT($B$8:$G$11, ($A$8:$A$11=$A15)*($B$7:$G$7=B$14)))
Fill right and down as necessary.
        
It is critically important that the column header labels match exactly; no leading spaces on one or the other.

Resources