I have a list of Excel data set up like this.
Items
1, 11, 3
4, 5, 6
7, 9, 12
15, 13, 4
7, 8, 9, 10, 1
14
1, 3, 7, 9
I want to make a count of each occurring number, so that I end up with a result like this:
Items A2 Column
1 2
2 0
3 2
4 2
5 1
And so on. Are there any formulas I can use to count the frequency of each number?
I've tried using the COUNTIF function, but the formula will often come out as 0 because it can't read each number separately in the cells. Using a Pivot Table created the same results as well.
First split those integer values into their own cell:
Data>>TextToColumns>>Delimited>>Comma>>OK
Second set up a table where 1 through whatever is listed in the rows, then you can use countif() to get the counts.
=COUNTIF($A$2:$E$8,A14)
Where $A$2:$E$8 is the group of cells that was created with Text To Columns, and A14 is the first cell in your list of of 1 to whatever. Copy that down to each row in your list of 1 to whatever and you'll have what you are looking for.
Assumptions Made:
-Your data is all in column A but in multiple rows.
-Each cell in column A has one or more comma separated data sets (as shown above)
In Column D1 Place a Title "Items" and enter your item numbers in column D starting with D2 and continuing.
In Column E use the following Formula
=SUM(COUNTIF($A:$A,D2&","),COUNTIF($A:$A," "&D2),COUNTIF($A:$A,", "&D2 &","),COUNTIF($A:$A,D2))
Explanation:
COUNTIF($A:$A,D2&",*") - finds entries for the specified item that are the first item in a data set with more than one item listed
COUNTIF($A:$A,"* "&D2) - finds entries for the specified item that are the the last item in a data set with more than one item listed
COUNTIF($A:$A,", "&D2 &",") - finds entries for the specified item that are neither the first, nor the last item in a data set with more than one item listed
COUNTIF($A:$A,D2) = Finds entries for a specified item where the data set only contains one item.
Related
If I have table 1 with OrderIDs and CallIDs and table 2 with CallIDs (that are referenced in table 1) and callDates, how can I find the number of orders within a given date range?
I believe what I need to do is get the calls that are within a date range in table 2, then check if the CallIDs exist in table 1, then get the count of the result. I just do not know how to put it all together in a formula. For instance in the picture, the number of orders in February should be 3.
=SUM(COUNTIFS(E2:E15,">="&DATE(2022,2,1),E2:E15,"<"&DATE(2022,3,1),D2:D15,B2:B8))
COUNTIFS creates an array of 0's and 1's (respectively FALSE and TRUE) for the date range in column E containing values greater than or equal to February 1st and smaller than March 1st and where the call number from column D is found in column B.
SUM adds up the 1's and 0's resulting in your count of matches in that range.
I have an excel sheet of data. I have to prepare report based on gender and age wise distribution count. The excel sheet has three columns NAME, GENDER, AGE. I have to get the count of Male, Female Population according to age distribution of
Under 10
10 yrs - 18 yrs
19 yrs - 49 yrs
50 yrs - 59 yrs
Above 60 yrs
How can I get the count in excel? I have no idea of excel programming. Attached herewith is only sample data I have thousands of rows of actual data. I have no idea how to do such analysis in excel. Please help!!!
I've attached the data as well as required count format in the image.
#Ted Williams, I didn't find a solution as you suggested. I failed to get rows or columns for each of the five age groups into the pivot table. So, I guess the task you set for OP was too difficult. Instead of a pivot table I used the formula below to assign each age to one of the five age groups.
[D2] =MATCH(C2,{0,10,19,50,60},1)
Next, I built a copy of your "Reporting Format" table in A17:K18 - five age groups with 2 columns each, just as you published it. Then I entered the next formula in B20 and copied all the way across to K20.
[B20] =COUNTIFS($B$3:$B$15,B$18,$D$3:$D$15,INT(COLUMN()/2))
Column D of the table this formula references contains the age groups already mentioned above and column B contains the gender. This table was copied form the data table you posted, assuming that the names are in column A.
INT(COLUMN()/2) is a counter which is built on the the original formula being in column B. COLUMN() returns the number of the column in which the formula resides. If the original is in column B it will return 2, 3, 4, 5, 6, 7, 8, 9, 10 as it is copied to B20:K20. Dividing this number into 2 will create a fraction which we can't use to address column numbers but the INT() function will round that fraction down. So, the result of =INT(COLUMN()/2) will be 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, exactly the age groups we have in column D and, of course (hopefully) the age group captions we have in row 17. The point of this explanation is that this function may return the wrong result if the original is not in column B. Adjust it like this, =INT((COLUMN()+x)/2) (where x is likely to be a negative number) and test it by itself in the columns in question to ensure that it returns the numbers 1 to 5, each number twice.
Here's what I meant:
Binned Age is from the table in H:I using index/match formula.
Pivot table uses BinnedAge then Gender for columns and count of name for values
If you want the bins sorted in a different order in the pivot table then see:
https://www.excel-university.com/sort-a-pivottable-with-a-custom-list/
I have two columns of raw data, one with 3,000 instances of numbers 0-100 the second with 3,000 instances of numbers 0-4.
I want to be able to extract the number of instances a range in column 1 has a 0 next to it. Then a 1, a 2, a 3, and a 4.
For example, how many times 0-29 in column 1 has a 2 next to it.
This is what COUNTIFS is for
=COUNTIFS(A:A,"<"&30,B:B,2)
I have a spreadsheet that contains users in each column. Below each user lists groups that they are in.
I want to highlight values that are not in every column.
If a user is part of a group that everyone is a part of, that group would not be highlighted.
If there was even one person who wasn't part of that group as well, that group would be highlighted.
Example.
Say there are 3 columns: A, B, C.
Column A has values 1, 2, 3, 4, 5 listed below it. Each number in a different row
Column B has values 1, 2 ,4, 5 listed below it.
Column C has values 1, 2, 4, 6, 7 listed below it.
In this example
In Column A, 3 and 5 would be highlighted.
In Column B, 5 would be highlighted.
In Column C, 6 and 7 would be highlighted.
Because each of those numbers are not listed every column.
So, you can do this using Conditional Formatting using the following logic:
Just for the sake of example, suppose your data is in the range A1:H20 with, as you said, each column being a new user and the first row A1:H1 being user names.
What this tells us:
COUNTA($A$1:$H$1) = Number of users
COUNTIF($A$1:$H$20,A2) = Number of times the value in A2 appears in your dataset
Therefore if COUNTIF($A$1:$H$20,A2) < COUNTA($A$1:$H$1), that means the value in A2 does not appear in each column (otherwise they woud be equal). (Also note that this is based on the assumption that you can't have a value appearing twice in a given column!).
At this point, it's a simple conditional formula.
Hope this explains it well enough.
I have searched through many similar topics but could find nothing that will do what I need.
I am trying to create a worksheet that will track scores for a darts game.
On Sheet 1 I have two columns that simply tracks each players throws from 501 down to 0
Row 25 is the amount remaining for each player.
In Sheet 2 I have 2 columns. The Column A contains scores that you can check out on, and Column B contains the checkout e.g. (T20, T20, D18). So if the value in row 25 of Sheet 1 matches any of the values in Column A of sheet 2, the I want to display the Value of Column B in the matching row on Sheet 2 Underneath the remaining score on Sheet 1.
Can anyone point me in the right direction?
not sure what you mean exactly, but this formula in row 26 should do the trick:
=index('Sheet 2'!$B:$B;match(A25;'Sheet 2'!$A:$A;0))
if your list separator is comma ,, use that instead of semicolon ;
you might want to use 1 as the third argument of match function, if you want to display the checkout according to the nearest match that is bigger than the number in row 25 and the column A in Sheet 2 is sorted in ascending order (1-9)
or -1 if you want the nearest match that is smaller and column A is sorted in descending order (9-1)
You can use this:
=IFERROR(VLOOKUP(A4, Sheet2!$C$2:$E$65535, 3, FALSE),0)