+ Reply to Thread
Results 1 to 10 of 10

Excluding Cells in COUNTIF() function.

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    Gainesville
    MS-Off Ver
    Excel 2010
    Posts
    5

    Excluding Cells in COUNTIF() function.

    Hello,

    I am trying to develop a visitor log for the building I work at on campus. The log will have nine columns and roughly 100 rows. Each column is a different type of data that must be entered by the security guard: Date, Name, ID Type, ID Number, Affiliation, Staff Visited, Badge # Issued, Arrival Time, and Departure Time. Currently I am stuck on a problem within the log.

    To stop a problem of guards signing out multiple people to one badge I want a color change or message to come up that symbolizes the badge is already checked out. This is fairly simple with the basic logic following along the lines of:
    IF Badge # cell is filled and IF Arrival Time cell is filled but Departure Time is blank, THEN check Badge # with other Badge #s that meet same criteria (Arrival Time filled, and Departure Time blank). Where I run into the issue is when I want to compare one checked out badge to all of the other checked out badges. I am basically making another column with will set all checked-out badges to their numbers, and all checked in badges to "0", since there is no "0" badge. But, If I compare to columns to look for duplicates, I need to exclude the cell being checked. I guess I can better explain this as G2:G102 are the badge numbers, and M2:M102 are the second badge number column made to check for duplicates. If I am checking G2 against the M2:M102, M2 will always be the same, because it is a duplicate of G2.

    I am trying to use a COUNTIF() function to do the comparison. Is there anyway to exclude a single cell from the function?

    Thank you for your time and please let me know if you can use more clarification.


    New Visitor Log - Copy.xlsx
    Last edited by CXF; 11-14-2012 at 10:02 AM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Excluding Cells in COUNTIF() function.

    Hello CXF,

    Welcome to the forum.

    Please upload a sample workbook to support your query.. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    Gainesville
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Excluding Cells in COUNTIF() function.

    I just tagged it to my original post.

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Excluding Cells in COUNTIF() function.

    Hi CXF,

    It would be better to relate if you could post some data as well as I found the workbook dont have any date to relate. thanks,

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    11-01-2012
    Location
    Gainesville
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Excluding Cells in COUNTIF() function.

    I added some data to the spreadsheet, one line of cells filled, except for the final cell.

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Excluding Cells in COUNTIF() function.

    I am not getting where you have added data.. sorry.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Registered User
    Join Date
    11-01-2012
    Location
    Gainesville
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Excluding Cells in COUNTIF() function.

    Try again, please. The wrong spreadsheet was linked. Sorry.

  8. #8
    Registered User
    Join Date
    04-11-2011
    Location
    Texas
    MS-Off Ver
    Office 2007
    Posts
    78

    Re: Excluding Cells in COUNTIF() function.

    Try this in Conditional Formatting:

    =IF($G2="",FALSE,(SUMPRODUCT(($G$1:$G1=$G2)*($I$1:$I1=""))))

    I applied it to $G$2:$G$102.

  9. #9
    Registered User
    Join Date
    04-11-2011
    Location
    Texas
    MS-Off Ver
    Office 2007
    Posts
    78

    Re: Excluding Cells in COUNTIF() function.

    IMO, you should also delete all the other Conditional Formatting rules you have, or at least modify them to capture a larger area, since most of them apply to one cell or don't do anything at all.

  10. #10
    Registered User
    Join Date
    11-01-2012
    Location
    Gainesville
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Excluding Cells in COUNTIF() function.

    Those other conditional formatting rules apply to other needs the spreadsheet requires. I'd take them out, but I would have to re-add them in later.

+ 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