Results 1 to 8 of 8

Thread: IF Statement

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2014
    Posts
    367

    IF Statement

    Hi...I have a spreadsheet with various columns. One column is the “Category” field and another one is the “Description” field.
    Where the category field says “Sales” the description field has content made up of a few elements and I want to separate the elements into other fields named Reference1, Reference2, Reference3 and Referance4.

    The description field is something like this

    Item - Ford Part Number - 1234 Customer Number – XXX111 Customer Name – JB

    In the Reference1 field I need something like where IF the category = “Sales” I want the “Item” to appear in Reference1 else Reference1
    In the Reference2 field I need something like where IF the category = “Sales” I want the “Part Number” to appear in Reference2 else Reference2
    The same for Reference3 and Reference4.

    Can anyone help please? Thanks

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: IF Statement

    In the description example you provided, is the item "Ford?" Is the part number "1234?" I'm not quite clear how to parse that string properly.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2014
    Posts
    367

    Re: IF Statement

    Hi yes in the example the Item is "Ford", Part number is "1234", Customer number is "XXX111" and the Customer name is "JB
    Each part is separated by a -

    Thanks

  4. #4
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: IF Statement

    So the first parse can't be based on the "-" so is the labeling consistent, for example you'll always have "Item," "Part Number," "Customer Number" and "Customer Name?"

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2014
    Posts
    367

    Re: IF Statement

    Quote Originally Posted by vbfbryce View Post
    So the first parse can't be based on the "-" so is the labeling consistent, for example you'll always have "Item," "Part Number," "Customer Number" and "Customer Name?"
    The labeling will always be the same just the descriptions will change.

    The category could be 'Sales', 'Purchases' etc. so it's only for where the category is 'Sales'.

    Thanks

  6. #6
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: IF Statement

    See if the attached gets you close.
    Attached Files Attached Files

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2014
    Posts
    367

    Re: IF Statement

    That's perfect. Thanks so much for your help.

  8. #8
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,574

    Re: IF Statement

    You're welcome

Posting Permissions

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



Click Here to Expand Forum to Full Width