+ Reply to Thread
Results 1 to 5 of 5

Help with COUNTIF formula with a twist

Hybrid View

  1. #1
    Registered User
    Join Date
    02-11-2016
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    3

    Help with COUNTIF formula with a twist

    Hello everyone, here is the situation.

    I have two sheets in a workbook, each with a list of serial numbers.

    A cell on the main sheet compiles the number of times a serial number is entered on either sheet and displays that number next to the serial number.

    Here is the formula: =COUNTIFS(sheet2!A:A,A4)+COUNTIF(A:A,A4)

    It works as needed. However, the twist now is that I need it to only calculate the number of instances on the condition that the serial number appears at least once on sheet2.


    As it functions now:

    Example 1 - Serial #:123456 appears 4 times on sheet1 and 3 times on sheet2. The total (7) is listed next to each instance of the serial number.

    Example 2 - Serial #:123456 appears 4 times on sheet1 and 0 times on sheet2. The total (4) is listed next to each instance of the serial number.


    How I want it to function:

    Example 1 - Serial #:123456 appears 4 times on sheet1 and 3 times on sheet2. The total (7) is listed next to each instance of the serial number.

    Example 2 - Serial #:123456 appears 4 times on sheet1 and 0 times on sheet2. A blank or zero value is listed next to each instance of the serial number.

    Anyone have any ideas? Thanks so much.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,943

    Re: Help with COUNTIF formula with a twist

    (How to) Upload a Workbook directly to the Forum
    (please do not post pictures or links to worksheets)
    • Click Advanced (next to quick post),
    • Scroll down until you see "Manage Attachments",
    • Click that then select "add files" (top right corner).
    • Click "Select Files" find your file, click "open" click "upload"
    • Once the upload is completed the file name will appear below the input boxes in this window.
    • Click "Done" at bottom right to close the Attachment Manager.
    • Click "Submit Reply"
    Note: Please do not attach password protected workbooks/worksheets
    Ensure to disable any Workbook Open/Autorun macros before attaching!
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    02-11-2016
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    3

    Re: Help with COUNTIF formula with a twist

    Workbook attached.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,943

    Re: Help with COUNTIF formula with a twist

    Using the sample, then:
    =IF(COUNTIF(sheet2!A:A,A4)>0,COUNTIF(sheet2!A:A,A4)+COUNTIF(A:A,A4),0)

  5. #5
    Registered User
    Join Date
    02-11-2016
    Location
    Canada
    MS-Off Ver
    Office 2013
    Posts
    3

    Re: Help with COUNTIF formula with a twist

    That works perfectly. Thank you so much.

+ 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. [SOLVED] Permutation Calculation Formula with a TWIST
    By cnyoon2 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-09-2013, 03:16 AM
  2. Sumifs formula with a twist
    By Cassi in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-26-2013, 10:42 AM
  3. Date of Birth formula with a Twist
    By dragnet in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-03-2013, 11:18 PM
  4. Adding a Hyperlink to a IF Formula ( with a twist )
    By jampy00 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-11-2012, 09:09 AM
  5. if and formula with a twist - can you help?
    By catts22 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-24-2010, 05:10 PM
  6. Count multiple formula.. but with a twist!
    By mcget in forum Excel General
    Replies: 4
    Last Post: 07-27-2009, 08:22 AM
  7. [SOLVED] Siple formula with a twist
    By Mike Busch in forum Excel General
    Replies: 1
    Last Post: 08-30-2005, 01: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