+ Reply to Thread
Results 1 to 6 of 6

If Formulas... Totaling data if

  1. #1
    Forum Contributor Gtrtim112's Avatar
    Join Date
    04-12-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2016
    Posts
    332

    If Formulas... Totaling data if

    I'm trying figure out a formula to calculate a sum based on criteria in a single cell...

    PHP Code: 
                         Total Vac Total Sick
    January
    Employee 1           1               2
    Employee 2           2               5

    March
    Employee 1           5               1
    Employee 2           4               0

    April

    May
    ....etc 
    Formula I tried:

    SUMIF(A3="Employee 1",SumB2:B12,0)

    Obviously, this doesn't work...

    I want to add the number of days a particular person takes Vacation or Sick time.

    Any help is appreciated!
    Last edited by FDibbins; 04-19-2013 at 07:32 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: If Formulas... Totaling data if

    you almost have it...

    =SUMIF(A2:A12,"Employee 1",B2:B12)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor Gtrtim112's Avatar
    Join Date
    04-12-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2016
    Posts
    332

    Re: If Formulas... Totaling data if

    Thanks, it worked!

    Can this same formula be used with other worksheets in the same file?

    For example: SUMIF(A2:A12,B3FromAnotherWorksheet,B2:B12)

    B3 from another worksheet would contain an employee name but I'd rather not be specific with the name because if that employee were to leave the company, the cell in which his name resides would be replaced by another name.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If Formulas... Totaling data if

    Just include the sheet name.

    Let's assume the sheet name is Sheet2.

    =SUMIF(A2:A12,Sheet2!B3,B2:B12)

    If the sheet name contains spaces or numbers then you have to use single quotes around the sheet name like this:

    sheet name: New Hires

    =SUMIF(A2:A12,'New Hires'!B3,B2:B12)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Contributor Gtrtim112's Avatar
    Join Date
    04-12-2013
    Location
    Alabama, USA
    MS-Off Ver
    Excel 2016
    Posts
    332

    Re: If Formulas... Totaling data if

    Awesome! Thanks so much for your help guys

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If Formulas... Totaling data if

    You're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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