Formula for searching for a text string

G

Guest

I have a table where each cell contains a string of various alphanumeric
codes. For example:
KB / S596-19
RM / S243-59
VB / I1997-1
KB / GEN
SV / GEN

I want to write a formula to count 1 if the cell is populated (not all cells
are), but count 0 if the cell contains 'GEN'.
I've tried this:
=IF(AND(B4<>"",B4<>"*GEN*"),1,0)

But the "*GEN*" portion of this formula does not work.

Any suggestions?

KellyB
 
D

Don Guillett

assumes gen is at the end??
helper column
=IF(AND(E2<>"",RIGHT(E2,3)<>"gen"),1,0)

without helper column
=SUMPRODUCT((LEN(E2:E22)>2)*(RIGHT(E2:E22,3)<>"gen"))
 
G

Guest

Tried that, but it didn't like it when FIND("GEN",A1) returned #VALUE, i.e.
when the cell did not contain GEN.
 

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