+ Reply to Thread
Results 1 to 5 of 5

Can Someone Explain how this formula works?

  1. #1
    Registered User
    Join Date
    06-08-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Can Someone Explain how this formula works?

    The following formula is used to count the number of dates in a column of which the date is later than the date stored in cell D1.

    I'm just looking for pointers on how it works.


    =SUMPRODUCT((C4:C25>D1)*(C4:C25<>"N/A"))

    Many Thanks
    Last edited by Brightspark; 06-08-2012 at 03:49 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Can Someone Explain how this formula works?

    Yes, here:

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

    and

    http://www.excelhero.com/blog/2010/0...umproduct.html
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Can Someone Explain how this formula works?

    Hi,

    In my opinion a straightforward =COUNTIF(C4:C25,"<>N/A") would have been preferable.

    SUMPRODUCT was more extensively used prior to XL 2007 which ushered in SUMIFS() and COUNTIFS() which largely did away with the need for the SumProduct array formula.

    It works by evaluating each row from C4:C5 in the two internal sets of parentheses. So for instance if C4 > D1 then a value of 1 is returned, and if not zero. Similarly if C4 <> "N/A" then that too will result in a 1. Therefore the effect of multiplying 1 x 1 for C4 gives the value 1. If say on C5 the two results are 1 & 0 then C5 will evaluate to 0. You can probably see therefore that the sum of all these individual row C results will give you the count of how many rows in C4:C25 meet both criteria.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    06-08-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Can Someone Explain how this formula works?

    [QUOTE=Richard Buttrey;2817372]Hi,

    In my opinion a straightforward =COUNTIF(C4:C25,"<>N/A") would have been preferable.

    Thanks Richard,

    But this formula doesn't compare the dates in column c to the date entered in D1.

    Any Ideas?

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Can Someone Explain how this formula works?

    Sorry,

    I mentioned COUNTIFS() plural and then didn't use it. Instead

    =COUNTIFS(C4:C25,"<>N/A",C4:C25,">"&D1)

+ 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