+ Reply to Thread
Results 1 to 8 of 8

Sum values in range of text strings based on other values

  1. #1
    Registered User
    Join Date
    10-05-2013
    Location
    Lancaster, CA
    MS-Off Ver
    Excel 2010
    Posts
    13

    Sum values in range of text strings based on other values

    Hello,
    In the attached file, I'd like to be able to total the numeric values that preceed certain alpha values in text strings. For example, Item #1 includes "5P" while Item #4 includes "1P", so B6 would be 6. I've played with search and mid, but can't figure out how to iterate through multiple rows and keep a running total (without VB).

    Thanks,
    Adam
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum values in range of text strings based on other values

    With text to column.

    After that I run the macro below.

    After that I made an pivot table of it.

    See the attached file.

    Please reply.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    10-05-2013
    Location
    Lancaster, CA
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Sum values in range of text strings based on other values

    We're not supposed to run macros on files in my workplace. Is there a way to do this without them?

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum values in range of text strings based on other values

    Please Login or Register  to view this content.
    Maybe by others.

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Sum values in range of text strings based on other values

    Try this array formula

    =SUM(IFERROR(MID(B1:B4,FIND("P",B1:B4)-1,1),0)*1)

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Change the highlighted portion for varied results
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum values in range of text strings based on other values

    With the solution of Ace_XL in the file.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-05-2013
    Location
    Lancaster, CA
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Sum values in range of text strings based on other values

    Money! thank you. I could have sworn I tried to reference the range, but it didn't work...guess not.

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Sum values in range of text strings based on other values

    Please Login or Register  to view this content.
    Who is money ?

+ 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. Summing values based on strings in a cell
    By MLomas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-23-2013, 01:46 PM
  2. Display Text Based on Values in Cell Range
    By kythom in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2013, 02:25 PM
  3. [SOLVED] Counting ammount of values within a range based on text
    By nonterrorist in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2012, 09:16 PM
  4. Replies: 2
    Last Post: 06-13-2012, 11:20 AM
  5. Replies: 0
    Last Post: 02-22-2011, 01:56 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