Count how many entries begins with a number

reaktorblue

Board Regular
Joined
Aug 8, 2007
Messages
87
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have 27 rows listed # to Z. What I'm trying to do is count how many entries in my table begin with each letter as well as 0-9. I've been able to figure out the A-Z part but the number part eludes me.

The numbers are formatted as text but also I'd like to combine them in such a way that any listing in my "Name" column that starts with a number would be counted. As an example, if "101 Dalmations" and "40 Days and 40 Nights" were listed in the name column, I'd expect to see a 2.


This is the formula that I have working for letters.
Code:
=COUNTIF(tblMovies[Name],E2&"*")
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
To further elaborate on that formula, is there a way to add an if statement to it? For example, I'm using the below formula to show me all the movies for "A" (which is in E2) that don't have a blank entry in the "Keep" column of the table.

I'd like to extend that same functionality to the movies that have a name starting with a number if possible.

Code:
=COUNTIFS(tblMovies[Name],E2&"*",tblMovies[Keep],"<>")
 
Upvote 0
I think I figured it out. It does appear working but I don't know if I actually did it right. Any thoughts or advice?

This should show all entries that are blank
Code:
=SUMPRODUCT(--ISNUMBER(--LEFT(tblMovies[Name],1))*(tblMovies[Keep]=""))

This should show all entries that are not blank
Code:
=SUMPRODUCT(--ISNUMBER(--LEFT(tblMovies[Name],1))*(tblMovies[Keep]<>""))
 
Upvote 0
how about PowerQuery (Get&Transform)

TitleCountTitle
101 Dalmations
2​
101 Dalmations, 1 dvb
40 Days and 40 Nights
2​
40 Days and 40 Nights, 423/321
ABC
3​
ABC, Ala, Amee
1 dvb
2​
Coca-Cola, Calibration
Coca-Cola
1​
Phone 111
Ala
1​
202 jumps
Phone 111
1​
Bruce allmighty
Amee
1​
Doudi doo
202 jumps
1​
567 Power
Bruce allmighty
423/321
Doudi doo
567 Power
Calibration

or

CriteriaCount
1
2​
2
1​
4
2​
5
1​
A
3​
B
1​
C
2​
D
1​
P
1​
 
Last edited:
Upvote 0
I'll have to look into that, it sounds quite interesting. I know I can accomplish what I'm trying to do already with a pivot table, which is what I used to use but I got tired of having to refresh the data every time I made a change to my table. With writing these as formulas, they update on the fly once I make a change to the table itself.

Its definitely worth looking into though.
 
Upvote 0
try these formulas with 1 000 000 rows and you'll see how it works :)

or even 100 000
 
Last edited:
Upvote 0
Yeah that makes sense. In this particular use case, its 3,133 rows, much of which are duplicates with 489 rows actually unique. I'd like to learn more about PowerQuery though, it sounds right up my alley but I don't know how useful for me since I don't really work with a large amount of data on my personal projects.
 
Upvote 0

Forum statistics

Threads
1,214,525
Messages
6,120,051
Members
448,940
Latest member
mdusw

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