+ Reply to Thread
Results 1 to 8 of 8

Average of comma separated numbers from multiple cells

  1. #1
    Registered User
    Join Date
    04-03-2020
    Location
    Oregon, USA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Average of comma separated numbers from multiple cells

    Hello,

    This is my first post on this forum. I am trying to average comma separated numbers from multiple cells. For eg. Take the first value of cell 39, first value of cell 40 and do the average as first value in cell 42. Similarly - Take the second value of cell 39, second value of cell 40 and do the average as second value in cell 42.

    Overall - I have data in hundreds of cells, so a scalable solution will be highly appreciated. Thank you all.
    Attached Images Attached Images

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Average of comma separated numbers from multiple cells

    Hi,

    If each cell within the range contains just two comma-separated entries, array formula**

    =TEXTJOIN(", ",,MMULT(TRANSPOSE(ROW(A39:A40)^0),0+MID(SUBSTITUTE(A39:A40,",",REPT(" ",99)),99*{0,1}+1,99))/2)

    which is scalable to larger, single-column ranges, e.g. A1:A100.

    Please clarify if there are in fact more than two comma-separated entries and, if so, whether this varies from cell to cell.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    04-03-2020
    Location
    Oregon, USA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Re: Average of comma separated numbers from multiple cells

    Hi XOR LX,

    Thank you for the quick reply.
    Yes, there will only be two values in each cell for all of the cells.
    I tried the formula you provided for 2 cells, replacing 99 by 2, but it is not giving the correct average. Still trying to understood the full formula. Attached is the image of the changes I made.
    Attached Images Attached Images

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Average of comma separated numbers from multiple cells

    Since your second picture appears to be identical to your first, in that the two cells to be queried are A39 and A40, I'm curious as to why you changed the formula I posted. Did you try the formula as it stood?

    I have just re-checked and it works fine as it stands, applied to a range of A39:A40.

    The 99 has nothing to do with the number of cells being queried, I should point out.

    It's true that the formula I posted would require a small amendment to work on ranges which also contain one or more empty cells, but that does not appear to be the case yet.

    Regards

  5. #5
    Registered User
    Join Date
    04-03-2020
    Location
    Oregon, USA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Re: Average of comma separated numbers from multiple cells

    My bad. I will used your formula as is and it worked perfectly. Thank you very much!

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

    Re: Average of comma separated numbers from multiple cells

    Hi and welcome to the forum,
    Try this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Two Cell Average CSV.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Average of comma separated numbers from multiple cells

    Quote Originally Posted by engineer_infinity View Post
    My bad. I will used your formula as is and it worked perfectly. Thank you very much!
    Ok, glad to hear it!

    As I mentioned, let me know if you need an amendment to account for potential empty cells within the range.

    Cheers

  8. #8
    Registered User
    Join Date
    04-03-2020
    Location
    Oregon, USA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Re: Average of comma separated numbers from multiple cells

    This works well too. Thanks MarvinP!

+ 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] AVERAGE of comma separated numbers in a single cell
    By EchoPassenger in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-25-2017, 09:42 AM
  2. [SOLVED] Extract Numbers from Comma-Separated String
    By k64 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-17-2017, 06:30 PM
  3. Separating multiple data separated by a comma into single cells.
    By sgmgrider in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-29-2015, 05:58 PM
  4. [SOLVED] Counting number of occurrences in cells with numbers separated by a comma
    By Losguapos1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-02-2013, 09:44 AM
  5. Separate numbers from characters separated by comma
    By hawk77EF in forum Excel General
    Replies: 6
    Last Post: 02-18-2010, 07:28 AM
  6. Separate numbers from characters that are separated by comma
    By hawk77EF in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-18-2010, 04:48 AM
  7. Replies: 0
    Last Post: 08-08-2005, 01: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