+ Reply to Thread
Results 1 to 5 of 5

If, Countif, Subtotal...?

Hybrid View

  1. #1
    Registered User
    Join Date
    07-24-2008
    Location
    Sutton Coldfield
    Posts
    14

    If, Countif, Subtotal...?

    Can't seem to get this one right:

    I basically need a formula to filter the rows that meet filter criteria in one sheet AND THEN to sum/subtotal the results of the items that have been filtered.

    In other words...

    If the word "Yes" appears in Sheet1, column A, row 1, take the monetary value of Sheet1, column B, row 1 and include it in a total shown on another sheet.

    To produce a total in Sheet2, I have currently used...

    SUBTOTAL(9,Sheet1!B:B)

    ... which works fine as long as I have already filtered the results in column A on Sheet1.

    However, as soon as I remove the filter on Sheet1, the subtotal/sum alters to include all values and not just those meeting the "Yes" criteria, above.

    If this is easy stuff, sorry!

    Thanks, in anticipation, for any help out there.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Try using SUMPRODUCT

    =SUMPRODUCT(--(Sheet1!A1:A50="Yes")*--Sheet1!B1:B50)

    Adjust the range to your requirements
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    07-24-2008
    Location
    Sutton Coldfield
    Posts
    14
    Perfect!

    Works a treat, as long as a range is included, as distinct to a whole column (i.e. A1:A100 and not just A:A).

    Thanks, oldchippy. You're a star!

    Kinds regards...

    Richard

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    That's correct Richard, SUMPRODUCT doesn't like whole columns like A:A, if you need to reference the whole column then A1:A65536

  5. #5
    Registered User
    Join Date
    07-24-2008
    Location
    Sutton Coldfield
    Posts
    14
    Thanks for that.

    All the best...

    Richard

+ 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