Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Sep 2003
    Location
    Wellington, New Zealand
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FIND Function (XP)

    <img src=/S/crybaby.gif border=0 alt=crybaby width=15 height=15> Life is hard ... especially when you're not necessarily mathematically inclined! I need help with the following scenario:

    Column A has data downloaded from a mainframe, which comprises of Product codes of 3 characters, and then up to four digits after the characters (e.g. BAC1634, WWT234, MCD326). For my purposes, the characters are irrelevant, but the digits following are. I've tried using the following formula in column B to differentiate into categories based on the digits:
    =IF(FIND(OR("16","17","18"),A1,4),"Fresh",IF(FIND( "2",A1,4),"Frozen",IF(FIND("3",A1,4),"By Product"))) - received error message #VALUE!

    Tried:

    =IF(FIND("16",A1,4),"Fresh",IF(FIND("17",A1,4),"Fr esh",IF(FIND("18",A1,4),"Fresh",IF(FIND("2",A1,4), "Frozen",IF(FIND("3",A1,4),"By Product"))))) - only works if the value is 16, receive #VALUE! error message if changed to any other digit.

    Could The Great Function Master help me please!

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: FIND Function (XP)

    How about this:
    =IF(OR(MID(A1,4,2)="16",MID(A1,4,2)="17",MID(A1,4, 2)="18"),"Fresh",IF(MID(A1,4,1)=2,"Frozen",IF(MID( A1,4,1)="3","By Product",NA())))

    It will give a #na error if neither of the 3 conditions are met.

    Steve

  3. #3
    New Lounger
    Join Date
    Sep 2003
    Location
    Wellington, New Zealand
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FIND Function (XP)

    I am not worthy <img src=/S/bow.gif border=0 alt=bow width=15 height=15> ... but thank you so much for the helping hand. <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23> This works perfectly (and thanks for the extra test to keep the challenge going with putting 2 into speech marks!!)

    Merry Christmas to you ... I'll put in a good word for you with Santa!!! <img src=/S/sing.gif border=0 alt=sing width=24 height=20>

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: FIND Function (XP)

    You are welcome.
    It wasn't actually an additional test. It is just the condition "response" when all the others are false (If I hadn't added this, excel would literally have FALSE as the formula result). If you want to put a message, just replace the na() with a text string (for example) "Invalid Code"

    Steve

Posting Permissions

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