+ Reply to Thread
Results 1 to 3 of 3

Sum Values Based on Criteria

  1. #1
    Registered User
    Join Date
    07-20-2019
    Location
    Wisconsin
    MS-Off Ver
    2019
    Posts
    14

    Sum Values Based on Criteria

    Pretty sure the title is the right phrasing for what I am looking for.

    On a worksheet I have titled "Job Numbers" I have in column c different job numbers going down by row. In column A I have bid hours for the job filled out. In column B I have used hours for the job that will need to be filled in so I can use it as comparison to make sure I am not going over my total bid hours.

    On another worksheet I have titled "Week Ending 7-20-19" I have a userform to fill out job numbers that will fill in specific cells, and job hours that will fill in specific cells directly above the job number.

    Here is the functionality I would need.

    I would need to identify all the matching job numbers from column c of the "Job Numbers" sheet to the numbers on the "Week Ending 7-20-19" sheet, select the value in the cell(s) directly above it, sum them into column b directly next to the corresponding job number on the "Job Numbers" sheet.

    Basically tallying up all the used hours for the job so I can compare them to what was bid.

    The kicker is that I will be adding sheets to this workbook for each week, and would like this function to keep working on every sheet, Example "Week Ending 7-27-19", " Week Ending 8-03-19" and so on. Also the Job numbers I have in column c of the "Job Numbers" sheet may be added to in the future.... (however only job numbers will ever be in column c).


    Thanks everyone!!!!!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-20-2019
    Location
    Wisconsin
    MS-Off Ver
    2019
    Posts
    14

    Re: Sum Values Based on Criteria

    Update: I have gotten this to work on a very micro level using
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    =SUMIF('WEEK ENDING 7-20-19'!J9:P9,"22463-0138",'WEEK ENDING 7-20-19'!J8:P8)+SUMIF('WEEK ENDING 7-20-19'!J10:P10,"22463-0138",'WEEK ENDING 7-20-19'!J11:P11)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    However this is not a sustainable method as a) job sheets will be continually added, making the equation obsolete when a new sheet "WEEK ENDING 7-28-19" is added. b) there may be the potential to have 100plus employee and 3plus job numbers...... this is an extremely long method for making this work.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Sum Values Based on Criteria

    The code below will loop through all the sheets and if the sheet name starts with "WEEK", it will sum the used hours for all the Job# in column C on Job Number Sheet and place them in corresponding rows in column B.

    To test the code, click the button called "Get Used Hours" on Job Number Sheet.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

+ 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. VBA Macro Dividing Values Based upon Matching Criteria and Description Criteria
    By pvsvprasad in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 09-18-2016, 12:39 PM
  2. Replies: 4
    Last Post: 05-19-2015, 11:53 PM
  3. [SOLVED] using SUMIFS and adding values based on multiple criteria based on selection from the drop
    By muheebrahman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2015, 12:55 AM
  4. [SOLVED] Sum of values based on values in different column with additional criteria
    By jimmyb555 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-15-2015, 02:31 PM
  5. [SOLVED] Count values in one list and then narrow/combine values based on criteria
    By razz0807 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2013, 08:02 AM
  6. [SOLVED] How to sum values based on multiple criteria with multple possibilities for each criteria?
    By boredaxel in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-05-2013, 02:26 AM
  7. matching values based on criteria and return values from another columns
    By lizard54 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2012, 11:29 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