+ Reply to Thread
Results 1 to 5 of 5

Concatenate with IF

  1. #1
    Registered User
    Join Date
    10-22-2022
    Location
    Virginia, US
    MS-Off Ver
    365
    Posts
    2

    Concatenate with IF

    Excel-lent friends,

    I'm working on a little inventory project in which I want to transition from Excel to Access. For a given item, the prior user has created a series of columns showing anytime it is moved. For example,
    1.PNG

    What I want to do is combine all of those moves from columns F through O into a Remarks column in E, delimited by a comma. I created this initially:

    =CONCATENATE(

    F2," ",TEXT(G2,"mm/dd/yyyy"),",",
    H2," ",TEXT(I2,"mm/dd/yyyy"),",",
    J2," ",TEXT(K2,"mm/dd/yyyy"),",",
    L2," ",TEXT(M2,"mm/dd/yyyy"),",",
    N2," ",TEXT(O2,"mm/dd/yyyy"))

    The problem was, for the non-blank values it gave me a 1/1/1900 result. I want to only combine if the date field has a value, and thought to use this IF statement:

    =CONCATENATE(

    IF(ISBLANK(G2), ??, F2," ",TEXT(G2,"mm/dd/yyyy"),",",)
    IF(ISBLANK(I2), ??, H2," ",TEXT(I2,"mm/dd/yyyy"),",",)
    IF (ISBLANK(K2), ??, J2," ",TEXT(K2,"mm/dd/yyyy"),",",)
    IF (ISBLANK(M2), ??, L2," ",TEXT(M2,"mm/dd/yyyy"),",",)
    IF (ISBLANK(O2), ??, N2," ",TEXT(O2,"mm/dd/yyyy")))

    This gave me an error of too many arguments. Can any of you provide a quick help on syntax to get me the result I'm looking for?
    Last edited by Wodin; 10-22-2022 at 10:28 AM. Reason: solved my issue

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Concatenate with IF

    I tested syntax but cannot test for data without your actual file (I'm not going to type in all your data from a screenshot). But try this:

    =CONCATENATE(

    IF(ISBLANK(G2),"",CONCATENATE(F2," ",TEXT(G2,"mm/dd/yyyy"),",")),
    IF(ISBLANK(I2),"",CONCATENATE(H2," ",TEXT(I2,"mm/dd/yyyy"),",")),
    IF(ISBLANK(K2),"",CONCATENATE(J2," ",TEXT(K2,"mm/dd/yyyy"),",")),
    IF(ISBLANK(M2),"",CONCATENATE(L2," ",TEXT(M2,"mm/dd/yyyy"),",")),
    IF(ISBLANK(O2),"",CONCATENATE(N2," ",TEXT(O2,"mm/dd/yyyy"))))
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-22-2022
    Location
    Virginia, US
    MS-Off Ver
    365
    Posts
    2

    Re: Concatenate with IF

    I'll have to go through the details to see where my error was, but you solved it. Works great. Thank you so much!

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: Concatenate with IF

    as you have 365 textjoin
    maybe this
    =TEXTJOIN(",",TRUE,IF(A1:E1>0,TEXT(A1:E1,"dd/mm/yy"),""))
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Concatenate with IF

    Quote Originally Posted by etaf View Post
    as you have 365 textjoin
    maybe this
    =TEXTJOIN(",",TRUE,IF(A1:E1>0,TEXT(A1:E1,"dd/mm/yy"),""))
    This is better than mine.

+ 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. [SOLVED] Vlookup and Concatenate or INDEX/MATCH and Concatenate
    By naumanxkhan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-03-2020, 09:44 PM
  2. Auto concatenate and reverse concatenate & Remove duplicates .
    By Andy308 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2016, 12:38 PM
  3. Concatenate with Double Info in Concatenate Cell
    By MRoz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2015, 02:07 PM
  4. Replies: 5
    Last Post: 08-28-2014, 06:01 PM
  5. [SOLVED] VBA concatenate script does not excute as expected, Concatenate and "&" can't be dragged
    By VBAlex in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2014, 09:25 AM
  6. Replies: 2
    Last Post: 04-12-2010, 12:35 PM
  7. [SOLVED] [SOLVED] I know how to concatenate ,can one de-concatenate to split date?
    By QUICK BOOKS PROBLEM- in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-26-2005, 01:05 PM

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