Excel Compare tables - excel

I have 2 excel pivot tables with 2 columns but got different number of rows.
The first column of each table got and Number, and the column 2 got a value.
I want to compare both tables, finding the same Number on Column 1 for each table, and sum the values of column 2.

The easiest way to do this is copy and paste (as values) the pivot tables to a new sheet, then use vlookup to compare the values Ref Vlookup. There are more complex and reusable solutions, but you would need to define if you want to use a macro, or other tools.

Related

How to get distinct count within pivot table(Excel for Mac) having filters?

Excel for Mac doesn't support Power Pivot and thereby doesn't have distinct count feature.
What is the best workaround to get distinct count in such cases?
Sample Excel Columns:
Period Criteria1 Criteria2 Criteria3 Data
Sample Pivot table:
Different values in 'Period' will be pivot columns.
'Criteria1' can be a filter to pivot table.
Both 'Criteria2'&'Criteria3' columns can be pivot rows.
Now, count of 'Data' can be obtained directly through pivot.
How to obtain distinct count of 'Data' ?
Answer Options
Using 'Countif' on raw data - Cons: Very slow on large data.
Counting unique keys made by concatenating Criteria columns - Cons: Gets complex and takes more effort in large data with many criteria columns
Is there any better workarounds to obtain distinct count within pivot table(Excel for Mac) having filters/multiple criteria's?
I think I had a comparable problem and here's how I "fixed" it.
Add a column to the table named "DistinctValue" - or "Crit2:Crit3" doesn't matter
Add a formula, concatenating the values from all fields you have as a row in your pivot table: =[#Criteria2]&":"&[#Criteria3] -
depends a little bit on your values, but for me : as concatenator
works fine. Space or no character may also work.
Add a column "Distinct"
Add a formula: =IF(MATCH([#DistinctValue],Y:Y,0)=ROW([#DistinctValue]), 1, 0)
Use this row in the pivot as a value with SUM and name it "Count".
This gives you a 1 for every first row of distinct values in your data table which is used in your Pivot. The data rows used for the pivot table should have exactly one row with a 1 for each section of rows. If you sum it up, you exactly get the distinct count.
If you add a new row to the pivot, you need to add it to the formula in 2. to get distinct values again.
Edit: You probably have to exchange , with ; for other languages in the formulas when also translating the formula names to German for instance.
The following solution has a few steps, but the payoff is that it scales very nicely, because the formula is just as performant on large sets as on small ones, as opposed to lookup/match which get slower the larger the set is.
(1) Custom sort on the fields with the duplicate values. e.g.
"Email Address"
n.b. If you prefer to count a particular instance (i.e. the record with the latest creation date), set the sort so that those duplicates will appear first.
(2) Create a new column, Call it Unique Count or what have you. In that column use a formula that is 1 if the preceding value and current value are not equal. E.g. =IF(EXACT(A2,A3),0,1)
(3) Fill down.
(4) Pivot on this table. Now when you do Count/Sum, use the Unique Count.

On an Excel pivot table, is there a way to apply different filters for each column

I have a pivot table that I have to change the filters 6 times to get all the totals I need. Can I sum each column based on unique filters for each column?
Just copy and paste the PivotTable 5 times, and change the filters on the other ones to get what you need. Or use the GETPIVOTDATA function to reference the 6 parts of a master pivottable that you want values for.

Excel: transpose rows to columns and merge

I would like to present some data in Excel in a table. I have a sheet with three columns: date, time_spent and user_id. Every row is a data record. I want a table with a column for every date and every value with time spent below the date.
Using the transpose function under paste special I get this:
However I would like only one column per unique date, so the amount of columns decrease like this:
Does someone know how to do this?\
I have more than 10000 rows, so manually is too much effort...
Using Pivot Tables as Tim Biegeleisen suggested I cannot get what I want either, I'm not an expierenced user of Pivot Tables so probably I'm doing something wrong:
Excel file as shown in above picture
Here is one way of using a Pivot Table as suggested by Tim above in the comments, but you must use it on your original, non-transposed data: (and note which parameters go to which areas.
A disadvantage of the Pivot table is that the column headers are text strings and not dates. If your version of Excel is 2010+, you can use Power Pivot or Get and Transform to do a better job:
Open the Query Editor, change the format of the Date column, and Pivot the column:
Then Save the results:
Advanced filter dates to unique values in a new column
Copy and transpose them to make your column titles
Insert a new column B with the formula =TEXT(A2,"yyyyddmmm")&COUNTIF($A$2:A2,A2) and fill down
Below your new column headers put in the formula =IFERROR(VLOOKUP(TEXT(H$1,"yyyyddmmm")&ROW()-1,$B$2:$C$8,2,FALSE),"") and fill down and across. You will need to fill it down to cover the maximum number of instances of each date.
Adding a sumif to this table and your initial table would be a good way to check you got everything.

Excel Pivot Tables - Use same field as row and column label

Looking to create a pivot table with the same field for row & column labels.
If this isn't possible in Excel, is there a suitable alternative within excel to accomplish the same result?
Plan B.
Two columns in your source data that are identical, one for ROWS one for COLUMNS.

Counting the same cells in Excel

I have a list of more than 2000 entries. I need to count the same entries and unique ones. For example, Excel will show that the cell, 'Out of cartridge', repeated 3 times. However, since I have more than 2000 cells, I can't use COUNTIF function because I can't write what to search in formula for thousands of entries. So, is there any formula I can use?
This can be achived by applying Pivot, do the following
Select the entire column which you need to count
Select Insert -> PivotTable option
On Pivot Table filed list drag and drop the same field to Row Lables and values.

Resources