+ Reply to Thread
Results 1 to 10 of 10

Add multiple values into a single row

  1. #1
    Registered User
    Join Date
    06-06-2013
    Location
    California
    MS-Off Ver
    2010
    Posts
    7

    Add multiple values into a single row

    I have a very simple excel sheet. It lists people, and the states they have mortgage licenses in.

    People listed on the right, States across the Top. (All 50 States are listed across the top like this: AL AZ CA CO CT, etc..)

    For each person, a date is put into the column of the state they have (telling me when they received the license)

    MY DILEMMA:

    All I want to do is create a formula to list all of the state abbreviations (top of columns) at the end of each row LIKE THIS: Joe Smith......... CA, IA, DE, etc.
    (its a lot to go through each row and then put the states at the end)

    How do I create a formula to add up the "value" in each column aka (the date) and LIST the Abbreviations for each State at the end of the row?

    Is it an "IF" or "COUNT"? I have no clue what to do.

    Is it possible? Let me know if I am not explaining this well. Thank you!
    Last edited by JBeaucaire; 06-06-2013 at 06:21 PM. Reason: Corrected Title, as per forum rules. Please take a moment to read the Forum Rules, link is above in the menu bar.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Add multiple values into a single row

    When you joined the forum recently you agreed to abide by the Forum Rules, but in haste I fear you might not have actually read them. Please stop and take a moment to read them now. We all follow these rules for the benefit of all, as must you. Thanks.

    (link above in the menu bar)

    In this instance, I fixed your title to follow the rules regarding titles.
    ===================================

    What you're describing is called String Concatenation, and believe it or not, Microsoft STILL hasn't added a simple String Concatenation formula we can use. So we have to write User Defined Functions (UDFs) of our own or resort to real-time active VBA. Either way, it's a VBA solution.

    If you're OK adding VBA to your project, post a copy of your workbook and I'll install one for you.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

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

    Re: Add multiple values into a single row

    Hi CapitalChick,

    You would be a lot better off keeping your data like the attached example. Jerry is correct in that a "simple" formula is not available in Excel (yet). A user defined function looks like your best alternative.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    06-06-2013
    Location
    California
    MS-Off Ver
    2010
    Posts
    7

    Re: Add multiple values into a single row

    Thank you everyone. I will attach my file to get some help and also try your formulas in the future as well.

    You have been Very helpful.. bummer though about the lack of simple formulas.

    PS. I have only used Excel a handful of times

    Thanks again

  5. #5
    Registered User
    Join Date
    06-06-2013
    Location
    California
    MS-Off Ver
    2010
    Posts
    7

    Re: Add multiple values into a single row

    Hi

    Thank you for correcting my Thread Title.

    Please Excuse my ignorance.. I'm not sure what you mean by VBA, but yes, If there is a solution - YAY!!
    If you could put in a code for me I would be over the moon!

    The information in my Workbook is sensitive however.. Would I be able to send you a workbook, minus their personal info, that you can send back, and would be able to be edited again by me?

    Thank you.

  6. #6
    Registered User
    Join Date
    06-06-2013
    Location
    California
    MS-Off Ver
    2010
    Posts
    7

    Re: Add multiple values into a single row- VBA?

    Attached is my file.

    Thanks a million to all that have helped me.
    Attached Files Attached Files

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Add multiple values into a single row

    THis is the UDF I installed in your workbook:

    Please Login or Register  to view this content.
    You can see this by pressing Alt-F11 to open the VBEditor. It is installed in the new Module1 I added.

    Once the VBEditor is closed, you use this new function in a cell, like so in AP2, then AP2 is copied downward:

    =CONCATIFS($J$1:$AO$1, $J2:$AO2, "<>")

    The first parameter is the range of values you want strung together and returned.

    The second parameter is the range of cells on this row to test.

    The third parameter is the "test" on the second parameter cells. In this test, I'm just testing for any value at all. "<>" simply means to Excel, this cell is not blank.


    So, for every cell that is not blank on row 2, the value from row1 is added to the result. If no results, you will get a "none".
    Attached Files Attached Files
    Last edited by JBeaucaire; 06-07-2013 at 01:12 PM.

  8. #8
    Registered User
    Join Date
    06-06-2013
    Location
    California
    MS-Off Ver
    2010
    Posts
    7

    Re: Add multiple values into a single row

    WOW!! You are an outstanding person! Thank you so much!
    I could have never done this on my own... you just made my life so much easier!!
    Thank you again! This is great.
    Have a wonderful day!!!

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Add multiple values into a single row

    I've marked this thread as SOLVED for you.
    Next time, select Thread Tools from the links above and mark this thread as SOLVED. Thanks.

  10. #10
    Registered User
    Join Date
    06-10-2021
    Location
    Ha Tinh, Vietnam
    MS-Off Ver
    2010
    Posts
    1

    Re: Add multiple values into a single row

    Thank you so much!

+ 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