Counting the same cells in Excel - 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.

Related

How can I create a table in Excel from a spreadsheet that contains data that is grouped in rows

I have a thousands of rows of here data in a spreadsheet (excel 1 image) that I need to create a table with the data populated across the headers below.
If you don't want to use a VBA or spend time with other custom queries, you can do something like this (not, need to create helper column):
Create a helper column that does a count if:
Using this formula:
=IF(B2="Facility ID:", COUNTIFS($B$1:B2,"Facility ID:"),"")
Then structure your data table like this:
And you can use this formula (starting in cell I7):
=INDEX($A:$E,MATCH($H7,$A:$A,0)+I$4,I$5)
Then all you need to do is drag down the rows and increment the counts and it should work provided that the spacings always stay the same and the locations of the fields also stay the same
This solution requires a version of Excel that supports XLOOKUP and Dynamic Arrays.
I would add two columns. One to count records and one to count the line number of the record like so.
E2 is =IF(A2="Facility ID:",MAX(E1:$E$1)+1,E1) and F2 is =IF(E2=E1,F1+1,1). Those formulas are dragged all the way down with the exception of the last row. That is a 6 manually entered because the typical 4th and 5th line are missing from that record.
Then sheet2 looks like this.
A2 counts the number of total rows of data in sheet1. =COUNT(Sheet1!E:E)
Rows 3 and 4 show the positions of each field within the record.
A6 starts a list from 1 to number of records. =SEQUENCE(MAX(OFFSET(Sheet1!E2,0,0,B1))) This uses the dynamic array functionality to spill into multiple cells.
The formula in B6 spills into multiple cells as well.
=XLOOKUP($A6#&B$3,OFFSET(Sheet1!$E$2,0,0,$B$1)&OFFSET(Sheet1!$F$2,0,0,$B$1),OFFSET(Sheet1!$A$2,0,B$4,$B$1),"")
I used OFFSET in the formulas so they can update if additional data is entered.
Finally, copy the formula in B6 to the other columns.

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.

Use Excel countifs with unique values

I have the following sheet:
I then use the following formula to count the number of each type in each area/country:
=COUNTIFS($B$2:$B$19,"UK",$C$2:$C$19,"A") and I get the following result:
My problem is that I only want the same name to be counted once per area/country, therefore the value for UK / A should be 4, not 8. Does anyone know how to accomplish this?
Regards
Crouz
Concatenate your name/location columns and do your countif using that. It's not pretty, but it will do what you want.
I would do a pivot on a pivot. Both should be in classic pivot table format.
Let me walk you through the logic:
1st Pivot
Pivot your initial data. Format pivot to be classic (right click -> PivotTable Options -> Display -> Classic .. -> ok)
As Row labels have Location, Type and Name. in Values put anything you want i have chosen count of Name.
Remove subtotals, grand totals from pivot and Repeat item labels or columns Location and Type(i am assuming you have excel >= 2010). http://www.extendoffice.com/documents/excel/1964-excel-repeat-item-labels.html
2nd pivot
Pivot your 1st pivots data. Pivot to classic view. in Row Labels have Location and Type and in values whatever you want os count i have chosen count of Location. Remove sub/grand totals and repeat items and your done.
This is what i have
Another alternative is to remove the duplicates. On the data tab, click on remove duplicates. It will then all you for the criteria to use. Select all three columns. It should then work as you expect

Excel Compare tables

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.

Trying add up values but have multiple entries

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?

Resources