Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 21
Default Comparing the first 2 characters of a coloumn to a string

Hi. I'm looking for a way to compare the first 2 charcters of a range of
cells in a column to a string and if any of the cells contain that string to
drop an "ok" result into the formulas cell if none contain it "not ok" is the
result I'm looking for

Range of cells being compared is B10:B19 searching for the text "b3" as the
first two characters in the cells.

I've tried Vlookup nested with an if I just get errors, I've tried lookup
nested with if, I've spent about 2 hours searching various forms and have yet
to find a way to compare the entire range in a formula or two.

I'm hoping its just me screwing something up on the vlookup/lookup. But
everything I've tried so far either only for comparing vs 1 cell and not a
range, or just gives #value or #N/A as a result when comparing the range.

I'll be more then happy to rebuild any of the forumlas I have tried if
anyone thinks that might help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Comparing the first 2 characters of a coloumn to a string

If I understand what you're wanting to do I think this will work:

=IF(COUNTIF(B10:B19,"b3*"),"OK","not OK")

--
Biff
Microsoft Excel MVP


"Jaime" wrote in message
...
Hi. I'm looking for a way to compare the first 2 charcters of a range of
cells in a column to a string and if any of the cells contain that string
to
drop an "ok" result into the formulas cell if none contain it "not ok" is
the
result I'm looking for

Range of cells being compared is B10:B19 searching for the text "b3" as
the
first two characters in the cells.

I've tried Vlookup nested with an if I just get errors, I've tried lookup
nested with if, I've spent about 2 hours searching various forms and have
yet
to find a way to compare the entire range in a formula or two.

I'm hoping its just me screwing something up on the vlookup/lookup. But
everything I've tried so far either only for comparing vs 1 cell and not a
range, or just gives #value or #N/A as a result when comparing the range.

I'll be more then happy to rebuild any of the forumlas I have tried if
anyone thinks that might help.



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
Comparing characters in one cell to multiple cells Quirthanon Excel Worksheet Functions 1 August 30th 07 03:38 AM
summing characters in a string DMG Excel Worksheet Functions 4 December 20th 05 02:44 PM
How to move characters to the end of the string Phil Excel Worksheet Functions 1 August 26th 05 03:06 PM
select a string of characters Did Excel Worksheet Functions 7 August 17th 05 04:24 AM
pulling characters out of a string Patrick Excel Worksheet Functions 3 November 12th 04 06:58 PM


All times are GMT +1. The time now is 09:14 PM.

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

About Us

"It's about Microsoft Excel"