+ Reply to Thread
Results 1 to 7 of 7

Multiple If statement and concatenate

  1. #1
    Registered User
    Join Date
    12-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    40

    Multiple If statement and concatenate

    Can anyone see where this formula is going wrong? It won't accept it. I tried changing the parenthesis but still wont accept. Appreciate your help on this.

    IF(D2="ATLAS",CONCATENATE(G2,LEFT(E2,6),
    IF(D2="DOGS",CONCATENATE((G2,LEFT(E2,6)),
    IF(D2="GCS",CONCATENATE(G2,LEFT(E2)),
    IF(D2="IOWA",CONCATENATE((G2,MID(H2,7,4),RIGHT(H2,1)),
    IF(D2="RADAR",CONCATENATE(G2,CE,AC))))))

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Multiple If statement and concatenate

    Hi NYC4Life,

    You can do this yourself if you use the EVALUATE tool in Excel. See http://www.officearticles.com/excel/...soft_excel.htm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Multiple If statement and concatenate

    There should be 2 parentheses on the first line after the 6. Other than that, Marvin's idea is a great one.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,373

    Re: Multiple If statement and concatenate

    Some "questions" highlighted in red:

    IF(D2="ATLAS",CONCATENATE(G2,LEFT(E2,6)),
    IF(D2="DOGS",CONCATENATE((G2,LEFT(E2,6)),
    IF(D2="GCS",CONCATENATE(G2,LEFT(E2,6)),
    IF(D2="IOWA",CONCATENATE((G2,MID(H2,7,4),RIGHT(H2,1)),
    IF(D2="RADAR",CONCATENATE(G2,CE2,AC2))))))
    Last edited by TMS; 06-03-2013 at 10:59 AM. Reason: Mark additional errors => opening brackets
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,373

    Re: Multiple If statement and concatenate

    Oh, and there's no FALSE condition if none of those are TRUE.

    Regards, TMS

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,373

    Re: Multiple If statement and concatenate

    Try this:

    =IF(D2="ATLAS",CONCATENATE(G2,LEFT(E2,6)),
    IF(D2="DOGS",CONCATENATE(G2,LEFT(E2,6)),
    IF(D2="GCS",CONCATENATE(G2,LEFT(E2,6)),
    IF(D2="IOWA",CONCATENATE(G2,MID(H2,7,4),RIGHT(H2,1)),
    IF(D2="RADAR",CONCATENATE(G2,CE2,AC2), "no conditions match")))))


    You also had some doubled up opening brackets.


    @Guys: I don't think you can use Evaluate if you can't get Excel to accept the formula.


    Regards, TMS

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,373

    Re: Multiple If statement and concatenate

    And, a bit shorter:

    =IF(OR(D2="ATLAS",D2="DOGS",D2="GCS"),CONCATENATE(G2,LEFT(E2,6)),
    IF(D2="IOWA",CONCATENATE(G2,MID(H2,7,4),RIGHT(H2,1)),
    IF(D2="RADAR",CONCATENATE(G2,CE2,AC2), "no conditions match")))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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