new to all this and I need some help on what I assume is transposing data - multiple rows into unique columns with values against each id
Here's my current data set:
I need to get the data into this format:
Any assistance would be greatly appreciated!
1.Select any cell within your original table.
Go to insert tab and select Pivot table. Make sure that the range is your full table and ideally select the option to create it on a new worksheet.
Enter SKU as your row labels, attribute as the colmn label, and value as the value. It should bring sum of values, but you can change if that is not the case.
Related
I have a table with duplicated values in a column. How can I use this column, to provide unique values as a dropdown options in another cell? I want to be able to enter new rows in my table that might include already existing or new values and dropdown should automatically reflect this.
What I tried with UNIQUE(MyTable[MyColumn]):
Excel is not accepting this formula as a data validation source
I can spill UNIQUE(MyTable[MyColumn]) to range and name this range and use it as a data validation source, but the named range will not expand/contract automatically when my table data change
Excel will not accept UNIQUE(MyTable[MyColumn]) in a new table
You are on the right way - and yes: this is annoying and definitly not intuitiv.
You have to add a # after the reference to your range when naming it:
Then use the name for your validation list. It will now expand when you add a new row to the table.
D3: UNIQUE-Formula referencing the table-column
Name "lstValues": referencing $D$3#
then use lstValues
Alternative solution
Insert Power Query referencing original table as a source: = Excel.CurrentWorkbook(){[Name="MyTable"]}[Content]
RMB on a column to keep, Remove Other Columns (if any)
RMB on a column, Remove Duplicates
Close and Load to the sheet as a table, name table DropdownTable
Define new named range DropdownValues with reference to =DropdownTable (or =DropdownTable[#All] to include header)
Use =DropdownValues as a data validation source
I have a Pivot table and a formula with range of cells linked to this Pivot table. If I add a new row to the pivot source data, my Pivot table dynamically recognizes this and adjusts (i.e. adds a new row), however the linked selection does not (green selection, see image below; the last two rows were newly added to the Pivot source data).
Is there any way how to make sure that the selection updates with the Pivot? I would like to have the green selection dynamically adjust together with the pivot if possible. Thank you.
Thanks Fernando for a tip. In the end I have managed to do it a bit differently.
I have replaced the COUNTA function in the OFFSET with the count of unique values in Row Labels (in my case they are names of companies and each company has one value for each year range 2014-2016, 2017-2019).
I.e. now the OFFSET height is a result of formula which calculates the count of Row Labels meaning that every time I add a new company to my source pivot data the count of unique company names increases by one and consequently the AVERAGE range does too.
How to count unique values can be found here.
Anybody has an idea why i cant use pivot table count value that is a number for a calculated field in that same pivot table?
Here is the picture of what i mean:
Count field in the pivot table counts how many of the certain Models are in a table and i would need to use the following formula: Count divided by Sum of IN in this pivot table.
Every time i try to use the value from "Count" column it returns the #VALUE.
It might be a formatting issue where excel is not understanding that one of the numbers is a number. There are a couple of ways to address the issue.
Highlight the cells, Home>Number, then apply the number format.
Select the pivot table,
in the pivot table fields box, select the dropdown arrow in the values section and select Value Field Settings
Then select Number Format and then choose the desired formatting (likely Number)
Force it as a value in your formula.
I assume your formula looks something like
=D4/C4 or
=GETPIVOTDATA("Sum of Sum",$A$3,"Top","Top","Name","Bottom
")/GETPIVOTDATA("Count of Count",$A$3,"Top","Top","Name","Bottom ")
you can use the VALUE() function to create
=VALUE(D4)/VALUE(C4) or
=VALUE(GETPIVOTDATA("Sum of Sum",$A$3,"Top","Top","Name","Bottom
"))/VALUE(GETPIVOTDATA("Count of
Count",$A$3,"Top","Top","Name","Bottom "))
Create a new 'Calculated Field' in your pivot table that does the function for you.
Select the pivot table, then Analyze>Calculations>Fields Items & Sets>Calculated Field
Give your field a name, then for your formula, enter something along the lines of Count/Sum of IN. Use the Fields box to make sure you get the Field names right
Hopefully one of these options will help you get what you need.
I have an Excel Table named Table5 which consist of two columns CompanyCode and EmployeeLevel. Now my question is i want to get the unique values of EmployeeLevel columns. Take note that the length of the record is unknown. I am using the Table5[EmployeeLevel] as the range to include all the records in the Table5. Is there a formula that you can provide ? I cannot use ActiveX object to loop through each record. I must do it via Excel formula. The solutions I got are only usable when it is fixed how long the records are. but this record I am working on is a dynamic table.
Thanks in advance :)
Assuming your data looks like this:
The easiest way to do this is to create a Pivot Table based on Table5. In the Rows, add EmployeeLevel. In Data, add EmployeeLevel.
Change the data aggregation to Count rather than sum. You will get something like this.
When you add a new item to Table5, all you need to do is update the PivotTable (right-click on the PivotTable and click update).
If you need to use formulas, the following is a workaround.
In Column C, add the following formula (given the below data, adjust to fit):
=--(COUNTIF($B$1:$B2,$B2)=1)
This will return a 1 for every unique value in the table.
Somewhere on the sheet (in my case F2), I added the following formula to count unique values:
=SUM(Table5[Unique Value])
In my sample data, there are 14.
I then copied the following formula from F3 down 20 rows (I used 20 because I don't have that many unique values -- you say your table is variable, so pick a number of rows higher than the amount of unique values you expect in the future):
{=IF(ROW(A1)<=F$2,SMALL(IF(Table5[Unique Value]=1,Table5[EmployeeLevel]),ROW(A1)),"")}
Note -- the curly braces are an array formula -- do not add them by hand, enter the formula without them and confirm with ctrl+shift+enter
This will result in the unique values in ascending order:
You might be able to achieve the count from within the table itself, provided EmployeeLevel is sorted:
I am trying to look up the value in one column and pull the number from another column.
Of course, I could use the simple V-lookup or Match.
However, the first column of data has multiple entries that are the same. If I Vlookup it is just going to pull the first number in the second column.
I need to pull each number from the second column and somehow add them together. Despite the fact I have multiple entries.
If there is a way to consolidate the multiple entries in 1st column while also summing up the numbers in the 2nd, that would be great.
I would recommend a Pivot Table. To create one, select a cell in your data range (which needs to have column names in the first row. Choose Insert / Pivot Table from the Ribbon and select the New Worksheet option for the location.
In the Pivot Table list on the new worksheet, drag the name of the first column to the Row Labels box and the name of the second column to the Values box. The name in the Values box should turn to Sum of <2nd column name>.
The Pivot Table will now show a sorted list of the column 1 values and the summed values of column 2. In the example, you'll see that
Does SUMIF do what you are looking for?