+ Reply to Thread
Results 1 to 7 of 7

Excel to Ignore Text and Sum Values

Hybrid View

  1. #1
    Registered User
    Join Date
    05-30-2017
    Location
    Bay Area, CA
    MS-Off Ver
    2016
    Posts
    5

    Excel to Ignore Text and Sum Values

    Hi,

    I know this has been asked a few times but I am struggling if anyone can help. I have a CSV file with sample text below. I need to sum the values within the parenthesis down the columns.

    Column A          Column B
    10.25.4.0/23	14.1% (33/234)
    10.25.6.0/23	9.8% (23/234)
    10.25.8.0/24	18.3% (22/120)
    10.25.9.0/24	0.0% (0/231)
    10.25.10.0/23	4.0% (10/244)
    
    Looking to create this output
    Total                 (88/1063)
    We are summing the first portion down all columns and the second.
    (33 + 23 + 22 + 0 +10) / (234 + 234 + 120 + 231 + 244)
    Last edited by nfordhk; 05-30-2017 at 08:26 PM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Excel to Ignore Text and Sum Values

    Does this work for you...?

          --------A-------- ------B------- --C--- -----D-----
      1   Column A           Column B                        
      2   10.25.4.0/23      14.1% (33/234) 33/234          88
      3   10.25.6.0/23      9.8% (23/234)  23/234        1063
      4   10.25.8.0/24      18.3% (22/120) 22/120 0.082784572
      5   10.25.9.0/24      0.0% (0/231)   0/231             
      6   10.25.10.0/23     4.0% (10/244)  10/244
    C2: =MID(B2, FIND("(",B2)+1, FIND(")",B2) - FIND("(",B2) - 1) >> Copied down
    D2: =SUMPRODUCT(--(LEFT(C2:C6,FIND("/",C2:C6)-1)))
    D3: =SUMPRODUCT(--(MID(C2:C6,FIND("/",C2:C6)+1,LEN(C2:C6))))
    D4: =D2/D3
    HTH
    Regards, Jeff

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Excel to Ignore Text and Sum Values

    This is an array formula: **Must be entered with Ctrl+Shift+Enter key combination.
    Formula: copy to clipboard
    ="("&SUM(--TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B1:B5,"(","/"),")","/"),"/",REPT(" ",50)),50,50)))&"/"&SUM(--TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B1:B5,"(","/"),")","/"),"/",REPT(" ",50)),100,50)))&")"

    v A B
    1 10.25.4.0/23 14.1% (33/234)
    2 10.25.6.0/23 9.8% (23/234)
    3 10.25.8.0/24 18.3% (22/120)
    4 10.25.9.0/24 0.0% (0/231)
    5 10.25.10.0/23 4.0% (10/244)
    6
    7 (88/1063)
    8
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Registered User
    Join Date
    05-30-2017
    Location
    Bay Area, CA
    MS-Off Ver
    2016
    Posts
    5

    Re: Excel to Ignore Text and Sum Values

    The array formula helped me parse everything which is great but now I thought I'd be able to perform the auto sum. It doesn't add correctly though.

    Now my columns look like this

    COLUMN A                 COLUMN B               COLUMN C
    10.172.161.0/24	           20.0% (8/40)	              (8/40)
    10.172.162.0/24	            5.0% (10/200)	      (10/200)
    10.172.163.0/24	            0.0% (0/0)	              (0/0)
    10.172.164.0/23	            58.0% (259/446)         (259/446)
    Last edited by nfordhk; 05-30-2017 at 07:51 PM.

  5. #5
    Registered User
    Join Date
    05-30-2017
    Location
    Bay Area, CA
    MS-Off Ver
    2016
    Posts
    5

    Re: Excel to Ignore Text and Sum Values

    I'm having trouble expanding to all my columns, is there a limitation?

    ="("&SUM(--TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B1:B1436,"(","/"),")","/"),"/",REPT(" ",50)),50,50)))&"/"&SUM(--TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(B1:B1436,"(","/"),")","/"),"/",REPT(" ",50)),100,50)))&")"
    Last edited by nfordhk; 05-30-2017 at 08:24 PM.

  6. #6
    Registered User
    Join Date
    05-30-2017
    Location
    Bay Area, CA
    MS-Off Ver
    2016
    Posts
    5

    Re: Excel to Ignore Text and Sum Values

    I also tried putting the array in the row underneath everything but I just get a #VALUE
    Last edited by nfordhk; 05-30-2017 at 08:18 PM.

  7. #7
    Registered User
    Join Date
    05-30-2017
    Location
    Bay Area, CA
    MS-Off Ver
    2016
    Posts
    5

    Re: Excel to Ignore Text and Sum Values

    WOOOOOOOO found my error. Thanks everyone!!!

+ 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] Ignore Text in a Cell and Sum Only the Values of the First 3 Non Zero Numbers
    By akurei in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 05-31-2017, 04:27 PM
  2. [SOLVED] I want a formula to ignore text values in cell references
    By Russellrupert in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 06-05-2016, 03:53 PM
  3. Combine 2 Excel columns into 1 - use number and ignore text
    By emmafutter in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2016, 07:35 AM
  4. [SOLVED] Calculating turn around time for taskers and ignore text values
    By AndreBlush in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-18-2013, 02:44 PM
  5. How can excel ignore certain text when it searches for text?
    By jonathynblythe in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-18-2011, 08:33 PM
  6. Replies: 5
    Last Post: 04-26-2006, 09:10 PM
  7. Ignore Text, function only for numerical values
    By Daniel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2005, 02:06 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