Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Formula for searching for a text string

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Formula for searching for a text string

Try something like this:

=IF(ISBLANK(A1),0,IF(TRUE(FIND("GEN",A1)),0,1))

Dave


--
Brevity is the soul of wit.


"KellyB" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Formula for searching for a text string

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 "))

--
Don Guillett
SalesAid Software

"KellyB" wrote in message
...
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



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Formula for searching for a text string

Sorry, do this: =IF(ISBLANK(A49),0,IF(NOT(FIND("gen",A49)),0,1))

Dave
--
Brevity is the soul of wit.


"Dave F" wrote:

Try something like this:

=IF(ISBLANK(A1),0,IF(TRUE(FIND("GEN",A1)),0,1))

Dave


--
Brevity is the soul of wit.


"KellyB" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Formula for searching for a text string

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

"Dave F" wrote:

Try something like this:

=IF(ISBLANK(A1),0,IF(TRUE(FIND("GEN",A1)),0,1))

Dave


--
Brevity is the soul of wit.


"KellyB" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default Formula for searching for a text string

See my response to my post. My original suggestion was incorrect.
--
Brevity is the soul of wit.


"KellyB" wrote:

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

"Dave F" wrote:

Try something like this:

=IF(ISBLANK(A1),0,IF(TRUE(FIND("GEN",A1)),0,1))

Dave


--
Brevity is the soul of wit.


"KellyB" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sumproduct issues SteveDB1 Excel Worksheet Functions 25 June 3rd 09 04:58 PM
Return a text string when the result of VLOOKUP formula is #N/A jeremy nickels Excel Worksheet Functions 2 August 4th 06 05:26 PM
find text in a string formula Todd Excel Worksheet Functions 5 June 2nd 06 04:12 AM
Return a formula as text string to a cell Sharon Excel Worksheet Functions 4 April 18th 06 05:40 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM


All times are GMT +1. The time now is 10:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"