+ Reply to Thread
Results 1 to 4 of 4

Using function to compare entries

  1. #1
    Registered User
    Join Date
    06-29-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    41

    Angry Using function to compare entries

    Hello,

    I currently have this function: =COUNTIF(North!D:D,">="&C3)-COUNTIF(North!D:D,">"&C4)
    what this does is it counts how many dates in a worksheet called "North" are between the dates in cells C3 and C4.

    The problem i'm having is, i now need to create a function that will look at column C (that has pump names in it) in worksheet "North", and if it finds the same pump in worksheet named "NorthEquip", it will count it, and then give me that total in a different column.

    Thanks!

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

    Re: Using function to compare entries

    Do you mean like?

    =COUNTIFS(North!C:C,NorthEquip!$A$2,North!D:D,">="&C3,North!D:D,"<="&C4)

    assuming you have Excel2007 as per your profile. And assumes item to find in column C is in A2 of NorthEquip.

    for pre 2007:

    =Sumproduct(--(North!C1:C100=NorthEquip!$A$2),--(North!D1:D100>=C3),--(North!D1:D100<=C4))

    note, can't use whole columns...
    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
    06-29-2012
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Using function to compare entries

    hello thanks for replying.

    i used the formula you gave (i'm a 2007). and there are 3 pumps in column c that match the pump number in A2, but it only gave me a total of 2. So i'm not sure what the problem is.

    I am overall wanting this function to give me a count of how many entries there are that fall inbetween 2 dates, AND are found in the sheet "NorthEquip".

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

    Re: Using function to compare entries

    What do you mean by "are found in sheet "NorthEquip"? Are you comparing to a range of cells, and checking if any one is matched?

    If so:

    =SUMPRODUCT(COUNTIFS(North!C:C,NorthEquip!$A$2:$A$10,North!D:D,">="&C3,North!D:D,"<="&C4) )

+ 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