+ Reply to Thread
Results 1 to 6 of 6

Combining IF COUNTIF AND functions

  1. #1
    Registered User
    Join Date
    03-03-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Combining IF COUNTIF AND functions

    if countif and data.xlsx

    I am trying to do a if countif and all in one.
    I came as far as =IF(COUNTIF(F2:F3,F2)>1,0,1) which is in column C currently.
    What I am looking to do is, if the value in column F occurs more than once, count only the first occurrence and if it only occurs once, count as 1. This is what I was able to do in Column C.
    I also need to add the additional criteria that when the value in Column H is "Existing", it should return a 0 instead of 1.
    The new formula can be in Column D

    I tried something like this: =IF(AND(IF(COUNTIF(F2:F3,F2)>1,0,1),H3="Existing")=1,0,1) but it doesn't seem to work. Help!

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Combining IF COUNTIF AND functions

    try

    =IF(COUNTIF($F$2:F2,F1)>1,0,IF(H2="Existing",0,1))

    I changed the reference of the countif to contain the first F2 as an absolute reference. Your formula was not returning the correct results.

  3. #3
    Registered User
    Join Date
    03-03-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Combining IF COUNTIF AND functions

    if countif.png

    Thank you for such a quick response. That didn't work. If the attached image is visible to you, you will see it still returns 1 in F in cases when H= Existing. It needs to always return 0 for Existing and only count any other status. Hope this clarifies it. Thanks again!

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Combining IF COUNTIF AND functions

    Did you copy the formula down all the way? I get the correct result.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Combining IF COUNTIF AND functions

    Slight variation on teylyn's formula (maybe I understand the question differently?)...
    =IF(H2="Existing",0,IF(COUNTIF($F$2:F2,F2)=1,1,0))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    03-03-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Combining IF COUNTIF AND functions

    This was almost it! Thank you!! I tried a variation on it and it worked! Thank you again!
    =IF(I3="Existing",0,IF(COUNTIF(F3:F4,F3)>1,0,1)) was the solution.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need help combining advanced countif functions....
    By capy12 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-30-2013, 11:25 AM
  2. Combining IF and COUNTIF functions
    By cbee907 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-26-2010, 11:35 AM
  3. [SOLVED] Combining LOOKUP and COUNTIF functions
    By kate_suzanne in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-22-2006, 02:05 AM
  4. [SOLVED] Combining COUNTIF and AND functions
    By david in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 07-06-2006, 10:00 PM
  5. [SOLVED] combining countif and mid or right functions
    By Charles Woll in forum Excel General
    Replies: 5
    Last Post: 07-09-2005, 08:05 PM

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