+ Reply to Thread
Results 1 to 3 of 3

IF Cell Contents Start with STRING

  1. #1
    ConfusedNHouston
    Guest

    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. #2
    macropod
    Guest

    Re: 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" <ConfusedNHouston@discussions.microsoft.com> wrote in
    message news:31F2DFD4-4F44-4B2E-9BA2-25FCB776D74A@microsoft.com...
    > 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. #3
    MartinW
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1