If cell in range begins with value

jodre

New Member
Joined
Sep 29, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,

Trying to write a formula to check whether any cell in a range begins with a specific value.

This one works for checking any cell in a range beginning with "x", "y" or "z":
=SUM(COUNTIF(A:A,{"x*","y*","z*"}))>0

But changing it to check for cells beginning with specific value does not seem to work:
=SUM(COUNTIF(A:A,{"29*","y*","z*"}))>0

What am I doing wrong? Need to use some other formula, right?

Many thanks
Jodre
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
That formula will only work if the values in col A are text, how about
Excel Formula:
=COUNT(FILTER(ROW(A2:A100),(LEFT(A2:A100,2)="29")+(LEFT(A2:A100,1)="y")+(LEFT(A2:A100,1)="z")))>0
 
Upvote 0
Solution
That formula will only work if the values in col A are text, how about
Excel Formula:
=COUNT(FILTER(ROW(A2:A100),(LEFT(A2:A100,2)="29")+(LEFT(A2:A100,1)="y")+(LEFT(A2:A100,1)="z")))>0
Fantastic! Thank you for this.

Hope this will help someone else too.

Jodre
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,013
Messages
6,122,694
Members
449,092
Latest member
snoom82

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