+ Reply to Thread
Results 1 to 7 of 7

Use VBA to Add Values Based on Multiple Criterias

  1. #1
    Registered User
    Join Date
    12-12-2017
    Location
    india
    MS-Off Ver
    2016
    Posts
    5

    Use VBA to Add Values Based on Multiple Criterias

    Hello,
    I am new to VBA, and I was wondering if the following can be done. Basically, I need to extract a summary from a large data set (I have attached an example) into a separate sheet so I can export easily as a report.

    The summary should add up the hours based on location, date and service. Some of the services are to be combined, in the example, you will notice that the hours for Domestic RRD and CTL RRD are added together for the same location and date.

    Any help would be appreciated!
    Thank you!



    Location Date Service Hours
    TYC 12/1/2017 Domestic RRD 2
    TYC 12/1/2017 INTL RRD 7
    TYC 12/2/2017 Domestic RRD 2.5
    TYC 12/2/2017 CTL RRD 0.75
    CAS 12/1/2017 Domestic RRD 3.5
    CAS 12/2/2017 INTL RRD 9.5
    CAS 12/2/2017 Domestic RRD 1
    CAS 12/2/2017 CTL RRD 1.25





    Output: Should be on next sheet

    Location Date Service Hours
    TYC 12/1/2017 Domestic 2
    TYC 12/2/2017 Domestic 3.25
    TYC 12/1/2017 INTL 7
    CAS 12/1/2017 Domestic 3.5
    CAS 12/2/2017 INTL 9.5
    CAS 12/2/2017 Domestic 2.25

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Use VBA to Add Values Based on Multiple Criterias

    So just the two columns?
    If location and date are the same.?

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Use VBA to Add Values Based on Multiple Criterias

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.


    To add a file to a post

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Use VBA to Add Values Based on Multiple Criterias

    Rule 08: Cross-posting Without Links

    Your post does not comply with Rule 8 of our Forum RULES. Do not cross-post your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    No further help to be offered, please, until the OP has complied with this request.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Use VBA to Add Values Based on Multiple Criterias

    You have reported your own thread and said that you were not aware of the cross-posting rule. Your thread need not be deleted, but you must provide the links requested if you want help here.

    When you joined, you agreed to abide by the forum's riles, so read them before posting again, please: https://www.excelforum.com/forum-rul...rum-rules.html

  6. #6
    Registered User
    Join Date
    12-12-2017
    Location
    india
    MS-Off Ver
    2016
    Posts
    5

    Re: Use VBA to Add Values Based on Multiple Criterias


  7. #7
    Registered User
    Join Date
    12-12-2017
    Location
    india
    MS-Off Ver
    2016
    Posts
    5

    Re: Use VBA to Add Values Based on Multiple Criterias


+ 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. Count Unique Values based on multiple criterias
    By Dahlia in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-10-2016, 09:10 AM
  2. [SOLVED] Sum values based on multiple criterias in a list.
    By bellyb in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 11-03-2014, 11:00 PM
  3. [SOLVED] Count unique values based multiple criterias
    By Petter120 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-03-2014, 03:07 AM
  4. find top 10 values based on multiple criterias
    By saurabhlotankar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-27-2014, 01:47 AM
  5. [SOLVED] Populate Values in Multiple List Boxes based on Multiple Criterias
    By s2jrchoi in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-09-2013, 11:39 AM
  6. Macros to update cell values based on multiple criterias
    By ccernat in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-22-2012, 03:25 AM
  7. Replies: 4
    Last Post: 01-31-2012, 04:36 AM

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