+ Reply to Thread
Results 1 to 7 of 7

2 separate columns with numbers separated by commas and single numbers not, need sum

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    2

    Wink 2 separate columns with numbers separated by commas and single numbers not, need sum

    Good afternoon people. Thank you in advance. These forums are awesome and I appreciate it.

    Have 1 sheet with 2 columns (columns D and F) have numbers in them, if more than 1 number, then commas are used to separate numbers, so 1 comma per 2 numbers, 2 commas per 3 numbers and so on.

    In a separate column, (column I), need formula that counts the total amount of numbers and then multiplies the sum by 1200 for each row going down.

    Example:

    Row 7 has column D with (139, 123, 343) and column F with (134), in column I, essentially would be (4 numbers times 1200 equals 4800)

    In other words each number, regardless of amounts in column D and F equal 1200 each equally.

    Thank you again in advance.

    - Nary
    Last edited by Slothbob; 05-22-2013 at 04:12 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: 2 separate columns with numbers separated by commas and single numbers not, need sum

    Hi and welcome to the forum

    Assuming you are starting in row 1...
    =(LEN(D1)-LEN(SUBSTITUTE(D1,",",""))+1+LEN(F1)-LEN(SUBSTITUTE(F1,",",""))+1)*1200

    adjust references as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    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
    45,000

    Re: 2 separate columns with numbers separated by commas and single numbers not, need sum

    =((LEN(D7)-LEN(SUBSTITUTE(D7,",",""))+1)+(LEN(F7)-LEN(SUBSTITUTE(F7,",",""))+1))*1200


    Regards, TMS
    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


  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: 2 separate columns with numbers separated by commas and single numbers not, need sum

    Hey Trevor, seeing as we both gave (pretty much) the same answer, would you call that "data validation"? lol


  5. #5
    Registered User
    Join Date
    05-21-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: 2 separate columns with numbers separated by commas and single numbers not, need sum

    Thank you both for that. Excellent and most appreciated!!

  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
    45,000

    Re: 2 separate columns with numbers separated by commas and single numbers not, need sum

    @FD: absolutely: of course, I used the cell references in the OP example, but, other than that ... Great minds think alike


    @Slothbob: thanks for the rep.


    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,969

    Re: 2 separate columns with numbers separated by commas and single numbers not, need sum

    happy to help and thanks for the feedback

+ 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