+ Reply to Thread
Results 1 to 12 of 12

Countif based on relative cell

  1. #1
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    Office 2013
    Posts
    73

    Countif based on relative cell

    Ok so I have this forumula in a cell:

    =SUM((COUNTIF(F7:F69,"<=" & TODAY())),(COUNTIF(B7:B69,">=" & D7)))

    and the trouble I am having is that in the second Countif, I need it to check the cell in the "D" column relative to what cell is being checked in the "B" column. Right now it is checking every cell in "B" against "D7" instead of "D8, D9, D10", according to what cell in "B" is selected.

    Any help would be appreciated.

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

    =SUMPRODUCT((F7:F69<=TODAY())*(B7:B69>=D7:D69))
    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
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    Office 2013
    Posts
    73
    that didnt work, just gave me a 0. i tried using D7:D69 in my original formula but it didnt work

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Can you explain what exactly you are trying to accomplish, then?

  5. #5
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    Office 2013
    Posts
    73
    i want the Countif to check cells B7 thru B69, and count if the relative cell in the "D" column is greater than or equal to the cell in the "B" column

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

    =SUMPRODUCT(--(B7:B69>=D7:D69))

    what about the dates in F? Is that a separate count?

  7. #7
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    Office 2013
    Posts
    73
    yeah its basically taking the two Countif's and adding them together.

  8. #8
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    Office 2013
    Posts
    73
    Quote Originally Posted by NBVC
    Ok try:

    =SUMPRODUCT(--(B7:B69>=D7:D69))

    what about the dates in F? Is that a separate count?


    that didn't work either.

  9. #9
    Forum Contributor ptm0412's Avatar
    Join Date
    04-16-2008
    Location
    Vietnam
    MS-Off Ver
    Office 2003 and 2007
    Posts
    129
    Maybe this:
    =SUMPRODUCT(--(F7:F69<=TODAY()))+SUMPRODUCT(--(B7:B69>=D7:D69))
    Last edited by ptm0412; 07-15-2008 at 01:51 PM.
    Oldman Chatting: [email protected] Mailing: [email protected]

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    How didn't it work?

    this formula would compare B7 to D7, B8 to D8, B9 to D9, etc and sum up each time the value in B is greater than value in D...

    If you have blanks, then you need to adjust formula...

    =SUMPRODUCT(--(B7:B69>=D7:D69),--(B7:B69<>""),--(D7:D69<>""))

  11. #11
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    Office 2013
    Posts
    73
    ok it worked. thanks a bunch

  12. #12
    Registered User
    Join Date
    06-20-2012
    Location
    Jakarta
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Countif based on relative cell

    Hi All, I'm having something similar to solve so I don't want to start a new thread.
    What I need to do is: "count all occurences of cell value in Column A + cell value in Column B in the corresponding row is larger than 1000".
    In the logical sense, what I'd need is COUNTIF(A1:A100+B1:B100>1000) - but this doesn't work with two columns.
    I've seen other posts with comparing columns and count them based on criteria, but I haven't found any that shows me how to do countif based on sum of two columns...
    Any help is greatly appreciated.

+ 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