Wildcards in array formulas?

  • Thread starter Montys Python {wink wink}
  • Start date
M

Montys Python {wink wink}

Hello

I am trying to get a count of where item in column D begins with a 2
and the item in column F begins ma

Excel doesn't like the wild cards... all the numbers in column D begin
with a 2 (no exceptions) but are all different. Not everything in
column F starts with ma.

here is the formula that fails.
=SUM(IF(D2:D2808="2*",IF(F2:F2808="ma*",1,0)))

Any ideas?

cheers
 
F

Frank Kabel

Hi
try
=SUMPRODUCT(--ISNUMBER(FIND(2,D2:D2808)),--ISNUMBER(FIND("ma",F2:F2808)
))
 
M

Montys Python {wink wink}

Hi Frank

thanks for the faaaast response.

I tried that but it only returned a count of 2...I would expect a much
higher number.

Column D contains lots of blanks and lots of numbers that begin with a
2 eg.206698, 206687 etc.
Column F contains Product names..some of which begin 'Ma'

Would it help if column D was text and not number formatted? I
switched it around from one to the other and it didn't make a
difference.

thanks you are a lifesaver.
 
K

Ken Wright

=SUMPRODUCT((LEFT(D2:D2808)="2")*((LEFT(F2:F2808,2)="ma")))

or

=SUMPRODUCT(--(LEFT(D1:D29)="2"),--((LEFT(F1:F29,2)="ma")))
 
K

Ken Wright

You're welcome. Might be worth making a not of Frank's reply though, as this is
extremely useful when searching for a character(s) or number in 'any' part of
the cell, as opposed to limiting it to just the beginning or end etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top