+ Reply to Thread
Results 1 to 11 of 11

Thread: Countif based on relative cell

  1. #1
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    MS Excel 2007
    Posts
    49

    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 Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    Maybe you want?

    =SUMPRODUCT((F7:F69<=TODAY())*(B7:B69>=D7:D69))
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    MS Excel 2007
    Posts
    49
    that didnt work, just gave me a 0. i tried using D7:D69 in my original formula but it didnt work

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

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    MS Excel 2007
    Posts
    49
    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 Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    Ok try:

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

    what about the dates in F? Is that a separate count?
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

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

  8. #8
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    MS Excel 2007
    Posts
    49
    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
    103
    Maybe this:
    =SUMPRODUCT(--(F7:F69<=TODAY()))+SUMPRODUCT(--(B7:B69>=D7:D69))
    Last edited by ptm0412; 07-15-2008 at 01:51 PM.

  10. #10
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    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<>""))
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  11. #11
    Registered User
    Join Date
    12-21-2006
    MS-Off Ver
    MS Excel 2007
    Posts
    49
    ok it worked. thanks a bunch

+ 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.2.0