+ Reply to Thread
Results 1 to 7 of 7

Need Help - Multiple IFs and returns trimmed value

  1. #1
    Registered User
    Join Date
    10-29-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    62

    Need Help - Multiple IFs and returns trimmed value

    Hihi,
    I need a formula to return me the trimmed value if it meets the multiple criterias I set.

    Try to use the below formula but it does not work.

    =IFERROR(INDEX($B5:$B5,1,MATCH("Jane",B5:B5,0)),IFERROR(INDEX($B5:$B5,1,MATCH("Steve",B5:B5,0)),IFERROR(INDEX($B5:$B5,1,MATCH("Mary",B5:B5,0)),IFERROR(INDEX($B5:$B5,1,MATCH("Harry",B5:B5,0)),INDEX($B5:$B5,1,MATCH("Jenny",B5:B5,0))))))

    The above formula I used is only to return the value but I actually wanted a formula to provide me the trimmed value (meaning remove the characters from -xxxx) as well.

    Attached is the sample table.

    Appreciate all help!
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Need Help - Multiple IFs and returns trimmed value

    hi there. how about just:
    =LEFT(B2,FIND("-",B2)-1)

    if you want your formula to work, perhaps you can add a wildcard (*) in front of all names:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    you didn't input the desired answers you want though. so if i'm wrong, do let us know what are you expecting to see for each rows

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    10-29-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    62

    Re: Need Help - Multiple IFs and returns trimmed value

    Hi,
    This formula 50% corrects! but at the same time, I want my return value to be the characters before the dash (meaning to trim off the characters from -xxxx).

    =IFERROR(INDEX($B6:$B6,1,MATCH("*Jane",B6:B6,0)),IFERROR(INDEX($B6:$B6,1,MATCH("*Steve",B6:B6,0)),IFERROR(INDEX($B6:$B6,1,MATCH("*Mary",B6:B6,0)),IFERROR(INDEX($B6:$B6,1,MATCH("*Harry",B6:B6,0)),INDEX($B6:$B6,1,MATCH("*Jenny",B6:B6,0))))))

    Thanks in advance.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,153

    Re: Need Help - Multiple IFs and returns trimmed value

    Why not simple use the


    =LEFT(B2,FIND("-",B2)-1)


    What is point of checking the name?

  5. #5
    Registered User
    Join Date
    10-29-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    62

    Re: Need Help - Multiple IFs and returns trimmed value

    I only want specific ones. The table has many combinations.

    Therefore, the formula u given is too simplified.

    =LEFT(B2,FIND("-",B2)-1)

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: Need Help - Multiple IFs and returns trimmed value

    Try this:

    =IF(SUMPRODUCT(--(NOT(ISERR(SEARCH({"Jane","Steve","Mary","Harry","Jenny"},B2)))))>0,LEFT(B2,SEARCH("-",B2)-1),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Registered User
    Join Date
    10-29-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    62

    Re: Need Help - Multiple IFs and returns trimmed value

    Thanks, Glenn!

    Your formula works for me! Appreciate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Unable to use vlookup on a trimmed value
    By wtucker in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-14-2017, 02:48 PM
  2. How to Calculate Trimmed Mean without Rounding
    By duaxe_thore in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-06-2015, 08:22 PM
  3. [SOLVED] Trim and Keep the Trimmed Data
    By N Harkawat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 11:05 AM
  4. Trim and Keep the Trimmed Data
    By N Harkawat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 07:05 AM
  5. Trim and Keep the Trimmed Data
    By sally t in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  6. [SOLVED] Trim and Keep the Trimmed Data
    By sally t in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. Trim and Keep the Trimmed Data
    By sally t in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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