Counting Values from a Single Column

elmotactics

New Member
Joined
Oct 26, 2017
Messages
6
I have an unfortunately formatted report of repeat callers. It's a single column, with the phone number, and then all the dates/times it called in the cells blow it, and then the next number, and all the dates/times it called, etc... for thousands of cells. What I need to do is somehow count all the times each number called. It would look something like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Phone number 1[/TD]
[/TR]
[TR]
[TD]9/25/17 10:13am
[/TD]
[/TR]
[TR]
[TD]9/25/17 11:36am[/TD]
[/TR]
[TR]
[TD]Phone number 2[/TD]
[/TR]
[TR]
[TD]10/03/17 8:28am
[/TD]
[/TR]
</tbody>[/TABLE]
etc...

Is it possible to count the number of cells after each phone number until it runs up to the next phone number?
 
=IF(A1>100000,IFERROR(MATCH(TRUE,A2:$A$5000>100000,0)+ROW(A1)-1,COUNTA($A$1:$A$5000))-ROW(A1),"")

Confirm with CTRL-SHIFT-ENTER
Copy down.

Awesome, this worked! I had actually just arrived at the same conclusion (albeit much more roundabout) using 3 other formulas:

=IF(LEN(A2)=10,"Number","Date") To distinguish between dates and numbers

=MIN(IF(B2:B1280="Number",ROW(B2:B1280)-ROW(B2)+1))-1 As an array to count the number of dates after every number

=IF([@Count]=0,C3,"") To put the count in the same row as the number and leave blanks for everything else


Yours is much simpler though :)
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top