I have the following data in Excel sheet1.
I would like to transpose this data into columns in another sheet. I have used the following formula to do so
=TRANSPOSE(Sheet1!C3:J3)
Which gives the following output
As you can see, the first sheet is frequenced quarterly and the second sheet is frequenced monthly. When I transpose the data into the monthly sheet, is there a way to tweak this formula to have the same number appear in all three months of a given quarter? (so for 0.83 to appear in the first three months, 2.23 in the next three months and so on?)
You can benefit from INDEX and MATCH (Match will work only if headers in transposed data is exactly the same than source data):
Formula in B11:
=INDEX($C$3:$F$4;MATCH(B$10;$B$3:$B$4;0);ROUNDUP(MONTH($A11)/3;0))
Drag to left and down
Related
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
I have two sheets in my Excel file: Sheet1 and Sheet2.
In Sheet2 i have data with columns Severity and LodgedDate. In Severity there are multiple values like
sev-1
sev-2
sev-3
sev-4
In Sheet1 I want to calculate the no. of occurrences for sev-1, sev-2, sev-3, sev-4 for today, this month, this financial quarter, last quarter, older than last quarter.
Can anyone help?
Like
=COUNTIF(shee2, C2:C,"sev-1" , "Today").
Assuming the date is in column B, try along the lines of
=countifs(Sheet2!C:C,"sev-1",Sheet2!B:B,today())
For the current month
=COUNTIFS(Sheet2!C:C,"sev-1",Sheet2!B:B,">=1-Mar-2017",Sheet2!B:B,"<31-Mar-2017")
So, for a time frame enter the first and the last day of the time frame into two conditions.
You may want to use a pivot table instead of countifs formulas. It is a lot faster and won't require you to type out all the possibilities.
I have 2 worksheets, one with multiple columns of data where rows are given years and the other columns are values under the headers of names, and the second sheet lists rates by year (column) and by name (row).
I am trying to take each value in a given column of sheet1 and multiply it by the relevant rate (found by matching the year of each row and the name of its column to the table in sheet2) and then sum the products by name, but can only use a single cell to do all this.
So far I've tried SUMPRODUCT and got to =SUMPRODUCT(O$24:O$514,INDEX(Rates!$A$2:$X$200,MATCH(O$23,Rates!$A$2:$A$67,0),MATCH($D$24:$D$514,Rates!$A$2:$X$2,0))) but this seems to fall down at the MATCH($D$24:$D:$514,Rates!$A$2:$X$2,0) part, even entering as an array.
I've currently resorted to a clumsy series of SUMIF(2016)*INDEX/MATCH(2016 rate)+SUMIF(2015)*INDEX/MATCH(2015 rate) etc, but would really like to have forward compatibility without relying on formulae being updated!
slightly simplified image of the workbook, thanks for any help!
I would like to consolidates data in a table per day to a table per week.
I have an input table with all the days of the year in columns and all operators in rows. If an operator plans a holiday, we put a "H" on that day.
I'd like to have an output table with all weeks in rows and all operators in columns where I want to count the number of holidays an operator takes in a week.
Copy your data and Paste Special, Transpose into B1 of a new sheet. In A2 and copied down to suit:
=WEEKNUM(B2)
Select your data (entire columns would serve) and DATA, Outline, Subtotal, At each change in: (ColumnA), Use function: Count, Add subtotal to: tick each operator, OK.
I have a set of rows in Excel which contain data for a particular month. The month is identified by a column called 'Month' and the data in this column is in the format mm/yyyy.
Now, I would like to duplicate these records vertically for each of the next 11 months, and each time it is duplicated, the month rows should change for that month (e.g. the second time it is duplicated, the month rows should show February and then the next time March, etc.).
What's the best way to do this apart from copy and pasting 11 times and manually changing the months?
The OFFSET approach needs only two formulas copied over to a new sheet to set up the extended data set
This sample assumes
your current sheet is called sheet1
your month data mm/yyyy starts in row 2, and is in column A
Changing the sheet name and column in the two formulas below is easy, if your data to extract started on row 3 not row 2 then change all ROW()-2) to ROW()-3) etc
While the first looks messier than it really is (to add 1 month), the concept is straightforward. The OFFSET approach moves down one cell from Sheet 1 only every 12 rows, the month being tweaked each cell
In A2 put, =DATE(YEAR(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0)),MONTH(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0))+MOD(ROW()-2,12),DAY(OFFSET(Sheet1!A$2,INT((ROW()-2)/12),0)))
In B2 put, =OFFSET(Sheet1!B$2,INT((ROW()-2)/12),0) and copy over as far as you have fields
Surprisingly enough, Excel 2007 (only one I have available) understands mm/yyyy as a date, so the formula =TEXT(DATE(YEAR(A2),MONTH(A2)+1,1),"mm/yyyy") creates the next date, and can be copied down.
Duplicating other data would simply be a case of putting the values as =B2 and so forth