Logic question with Countifs function

anderma8

New Member
I have the following formula working:
=COUNTIFS('Detailed Incidents'!$D$2:$D$1000,”New Jersey”,'DetailedIncidents'!$I$2:$I$1000,”Newark”,'Detailed Incidents'!$B$2:$B$1000,”January*”,'DetailedIncidents'!$B$2:$B$1000,”*2018”))
But I want to include if another corresponding column hasANY of the following values: Resident,Visitor, Passing Through
I was thinking I would incorporate a nested if statement butI’ve run into a wall. Any suggestions onhow to append the formula to include a list of values?

 

Eric W

MrExcel MVP
Something like:

=SUM(COUNTIFS('Detailed Incidents'!$D$2:$D$1000,"New Jersey",'Detailed Incidents'!$I$2:$I$1000,"Newark",'Detailed Incidents'!$B$2:$B$1000,"January*",'Detailed Incidents'!$B$2:$B$1000,"*2018",'Detailed Incidents'!$Z$2:$Z$1000,{"Resident","Visitor","Passing Through"}))
 

anderma8

New Member
Thanks Eric! I've tried several versions using hard coded values as well as a range, but I'm still missing something... I'll keep trying!
 

Eric W

MrExcel MVP
If you use a range A1:A3, with Resident in A1, Visitor in A2, etc., you'll need to confirm the formula by pressing Control+Shift+Enter, not just Enter. Other than that, keep trying it. If you have more questions, let us know.
 

Some videos you may like

This Week's Hot Topics

  • Get External Data (long shot question!)
    This is likely a long shot but I am wondering if it is at all possible for Excel to somehow 'change' the contents of a URL that is being linked to...
  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • Cell Formatting
    Good Morning, I need to format a few different cells in the following manners: A1 has to always add a colon (:) after whatever is typed in by a...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • Workbook_Change stopped working !
    I am working on an app to speed up & automate processing of Credit Cards statements. After data is input from a CSV file, it is presented to the...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
Top