+ Reply to Thread
Results 1 to 7 of 7

How do I include a SUMIF in a IF(AND statement?

  1. #1
    Forum Contributor
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    How do I include a SUMIF in a IF(AND statement?

    I'm trying to pull data from a sheet within my workbook which is populated by using a VBA Userform. This (Database) sheet works fine and contains everything I need. I've named the columns in the database sheet. In a different sheet I'm trying to extract data from this sheet by using this formula:
    =IF(AND($C$3=Name,$C$5=Department,$C$4=Week),SUMIF(Work,$C15,Monday),0)

    The cells C3, C4 and C5 are entry fields in this sheet (from lookup tables to match exactly the conventions used in the data sheet). Cell C15 is static data looking for a match in the "Work" range.
    I'm not getting the results it should produce.

    Thoughts?
    Last edited by johnw993; 12-07-2012 at 11:12 PM. Reason: Solved!

  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,938

    Re: How do I include a SUMIF in a IF(AND statement?

    try using 1 of the new functions included in 2007 onwards...sumifS() from the sounds of it, that will give you what you want
    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
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    Re: How do I include a SUMIF in a IF(AND statement?

    Thanks FDibbins, I'm using MSOffice 2011 for the MAC and tried all latest features. The sumifS is not doing the job either. I'm missing something somewhere. Feel rather stupid, as I've been able to do this before.

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: How do I include a SUMIF in a IF(AND statement?

    Post your workbook

  5. #5
    Forum Contributor
    Join Date
    11-30-2012
    Location
    Colorado, US
    MS-Off Ver
    MS Prof. 2010 and 2013 + 365
    Posts
    113

    Re: How do I include a SUMIF in a IF(AND statement?

    SIMIFS did indeed work. Thank you for making me aware of this!

  6. #6
    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,938

    Re: How do I include a SUMIF in a IF(AND statement?

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neet and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below)

  7. #7
    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,938

    Re: How do I include a SUMIF in a IF(AND statement?

    Thanks for the rep

+ 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