+ Reply to Thread
Results 1 to 10 of 10

CountIf function ... adding another variable

  1. #1
    Registered User
    Join Date
    03-09-2015
    Location
    Liverpool, England
    MS-Off Ver
    Office 2007, Excel 2013
    Posts
    14

    Thumbs up CountIf function ... adding another variable

    Please help me!!

    I am using this function/formulae:

    =COUNTIF('Test Schedule'!V:V,B3)

    This function counts every value equal to cell B3 appearing in the 'Test Schedule' tab in column V.

    However, I want to added another variable – I don’t want to count all of these values - I want to exclude those entries where the value in 'Test Schedule' tab where column K equals “N” … that way, I only count the value where column "K" only reports on the value “Y”.

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: CountIf function ... adding another variable

    Here!

    =COUNTIFS('Test Schedule'!V:V,B3,'Test Schedule'!K:K,"Y")

    See if this works..
    Cheers!
    Deep Dave

  3. #3
    Registered User
    Join Date
    03-09-2015
    Location
    Liverpool, England
    MS-Off Ver
    Office 2007, Excel 2013
    Posts
    14

    Re: CountIf function ... adding another variable

    Thanks for the reply, it would work if it showed "Y" or blanks ... sorry!! I tried =COUNTIFS('Test Schedule'!V:V,B3,'Test Schedule'!K:K,"Y","") but it errors ...

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: CountIf function ... adding another variable

    Can you please attach a sample workbook, so that the requirement can be clear..

    So basically you want it to count the entries with Y as well as Blank Cells.. Is that correct?

  5. #5
    Registered User
    Join Date
    03-09-2015
    Location
    Liverpool, England
    MS-Off Ver
    Office 2007, Excel 2013
    Posts
    14

    Re: CountIf function ... adding another variable

    Yes, that is correct I want to count the entries with Y as well as Blank Cells

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: CountIf function ... adding another variable

    It would have been better with a Sample Workbook, however give this a try

    =COUNTIFS('Test Schedule'!V:V,B3,'Test Schedule'!K:K,"Y",'Test Schedule'!K:K,0)

    Hopefully this will work

  7. #7
    Registered User
    Join Date
    03-09-2015
    Location
    Liverpool, England
    MS-Off Ver
    Office 2007, Excel 2013
    Posts
    14

    Re: CountIf function ... adding another variable

    Hi, it didn't work, I have now attached ... the amount returned in total should be 68, not 71
    Attached Files Attached Files

  8. #8
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: CountIf function ... adding another variable

    Here!

    Put this in Cell C3 on Metrics Sheet and Drag Down

    =COUNTIFS('Test Schedule'!V:V,B3,'Test Schedule'!K:K,"<>"&"N")

  9. #9
    Registered User
    Join Date
    03-09-2015
    Location
    Liverpool, England
    MS-Off Ver
    Office 2007, Excel 2013
    Posts
    14

    Re: CountIf function ... adding another variable

    Great, thankyou ... I will close the thread ... I didn't know what <> meant ...

  10. #10
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: CountIf function ... adding another variable

    Glad it helps! <> means does not equal to..

    Cheers!

+ 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] Adding Second Variable to a Function
    By mcclanat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-09-2015, 06:17 PM
  2. How to use a variable in the Countif function
    By Nickmsi in forum Excel General
    Replies: 1
    Last Post: 05-19-2014, 07:59 PM
  3. [SOLVED] using Countif Function: Column number stored in a variable
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2014, 06:58 PM
  4. Countif Function / Variable
    By Mildoc in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-09-2012, 09:17 AM
  5. function malfunctioning using countif and a variable
    By Jean-Pierre D via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-19-2005, 04:05 AM

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