+ Reply to Thread
Results 1 to 7 of 7

How to Sum Rows within a named range based on text criteria

  1. #1
    Registered User
    Join Date
    07-15-2019
    Location
    Virginia, US
    MS-Off Ver
    2016
    Posts
    4

    How to Sum Rows within a named range based on text criteria

    I have a few named ranges with different costs broken down by month. I need a macro to take all the repeated titles (ex. travel) within the named range and sum them into one row, and repeat this for each named range. Basically consolidating the data, sorry for the funky table thats just for reference the splits between named ranges wont exist all the data is together.






    Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec FY 2019
    (first named range)
    Travel 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    Travel 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    Travel 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    Training 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    Telephone 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    Outside Serv 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    Indirect Labor 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    Fringe 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    (different named range)
    Travel 1,000.00 500.00 300.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,700.00
    Travel 1,000.00 500.00 75.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,475.00
    Training 1,000.00 500.00 75.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,475.00
    Supplies and Equipment 1,000.00 500.00 75.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,475.00
    Outside Services 1,000.00 500.00 75.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,475.00
    Other Employee Related Costs 1,000.00 500.00 75.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,475.00
    Other Employee Related Costs 1,000.00 500.00 75.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,475.00
    Other 1,000.00 500.00 75.00 900 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 2,475.00

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: How to Sum Rows within a named range based on text criteria

    Hi, welcome to the forum.

    You will get much better help if you provide a workbook... nobody wants to have to guess at replicating your setup to test.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Registered User
    Join Date
    07-15-2019
    Location
    Virginia, US
    MS-Off Ver
    2016
    Posts
    4

    Re: How to Sum Rows within a named range based on text criteria

    Included a worksheet example just need to sum the data in the named ranges with the same title (ex.Travel) into one row from each named range. Thanks
    Attached Files Attached Files

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: How to Sum Rows within a named range based on text criteria

    I don't see a named range, but I assume your data is an example of a named range's contents? Where would the output go? New sheet? New area? Should the program make the new sheet or will you have a sheet already?

  5. #5
    Registered User
    Join Date
    07-15-2019
    Location
    Virginia, US
    MS-Off Ver
    2016
    Posts
    4

    Re: How to Sum Rows within a named range based on text criteria

    Wherever is easiest to output, creating a new sheet would suffice. The data is sorted in each named range, so a new named range begins with a section of travel rows. Ex. Named range 1 would be rows 1:22, then the next would be 23:40 and so on.

  6. #6
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Question

    Where is the expected result worksheet ?‼

  7. #7
    Registered User
    Join Date
    07-15-2019
    Location
    Virginia, US
    MS-Off Ver
    2016
    Posts
    4

    Re: How to Sum Rows within a named range based on text criteria

    Attached is a worksheet with a small sample of the desired outcome highlighted in yellow next to original data.
    Attached Files Attached Files

+ 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] Named range of multiple rows based on text criteria
    By EmXLS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2019, 04:33 AM
  2. Dynamic named range based on two criteria
    By Samantha McNeill in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-20-2018, 06:14 AM
  3. [SOLVED] COUNTIFS - Criteria based on a named range.
    By paularthur90 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-16-2014, 09:24 AM
  4. [SOLVED] Dynamic Named Range to Auto-Populate another range based on criteria
    By BeachRock in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-24-2014, 06:46 PM
  5. Replies: 1
    Last Post: 11-28-2013, 05:38 AM
  6. Change Row Font Color based on criteria in named range
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2013, 07:44 PM
  7. [SOLVED] Ranking based on 2 criteria with named range
    By Webbers in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-19-2012, 07:21 AM

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