Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
ConfusedNHouston
 
Posts: n/a
Default IF Cell Contents Start with STRING

How would I write an IF statement that instructs Excel to evaluate the first
six characters in a given cell? By that I mean, IF(A1 begins with ABCDEF,
then, ,). IF(A2 begins with GHIJKL, then, ,). Hmm, I will need several of
these IF's in a row since the contents could begin with about 8 differing
text patterns. How would I string the IF arguments together?

I want to perform a REPLACE on a group of cells that contain brand names.
Different brand names, different string lengths, therefore the need for the
IF statements.

Thanks....
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
macropod
 
Posts: n/a
Default IF Cell Contents Start with STRING

You'd be better off constructing this with a LOOKUP function, especially
since IF statements can only be nested 7 levels deep.

Cheers


"ConfusedNHouston" wrote in
message ...
How would I write an IF statement that instructs Excel to evaluate the

first
six characters in a given cell? By that I mean, IF(A1 begins with ABCDEF,
then, ,). IF(A2 begins with GHIJKL, then, ,). Hmm, I will need several

of
these IF's in a row since the contents could begin with about 8 differing
text patterns. How would I string the IF arguments together?

I want to perform a REPLACE on a group of cells that contain brand names.
Different brand names, different string lengths, therefore the need for

the
IF statements.

Thanks....



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
MartinW
 
Posts: n/a
Default IF Cell Contents Start with STRING

Here's Dave Peterson's answer to a similar question in another forum. It
might help a little.


How about adding another column, then extract the first 5 digits of that
value.

=left(B2,5)
(if they're always 10 characters)

or
=left(text(b2,rept("0",10)),5)

or something????

Then use that column to extract the data.


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
How do I get a number or letter to represent cell contents? Formula help Excel Discussion (Misc queries) 2 February 25th 06 11:51 PM
dynamic cell reference within a text string gvm Excel Worksheet Functions 4 July 25th 05 02:40 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Copy cell format to cell on another worksht and update automatical kevinm Excel Worksheet Functions 21 May 19th 05 11:07 AM
cell contents Kevin Excel Discussion (Misc queries) 1 March 8th 05 11:23 AM


All times are GMT +1. The time now is 05:36 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"