Look for a given number in a range

ManUBlueJay

Active Member
Joined
Aug 30, 2012
Messages
304
Office Version
  1. 2016
Platform
  1. Windows
I am looking for a way to count how many times a given number apears in my range. The number I am looking for is based in Cell A1
Example. Cell A1 = 25

Range I am looking in is Col B1 to B100.
The cells will either have whole numbers or a whole number with a single letter at the end. The formula in this case should equal 4

12
12b
20
20c
25
25a
25b
12d
25e

Any help would be appreciated
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
This array-entered** formula seems to work...

=SUM(IFERROR(0+(0+LEFT(B1:B100,2)=A1),0))

**Commit this formula using CTRL+SHIFT+ENTER and not just Enter by itself
 
Upvote 0
How about
Excel Formula:
=COUNTIF(B1:B100,A1&"?")+COUNTIF(B1:B100,A1)
 
Upvote 0
Solution
Thank you. Both of them work, I will go with the second to avoid the array
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Similar Question but how do I find how many rows on the next whole number would be.
So if I change A1 to "12" the next non text number would be 2 rows on from 12.
SO it needs to find A1 and look for the next number after.
 
Upvote 0
As this is a totally different question, you will need to start a new thread. Thanks
 
Upvote 0

Forum statistics

Threads
1,215,487
Messages
6,125,085
Members
449,206
Latest member
ralemanygarcia

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