• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Count Cells with an AND condition, or another alternative|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Count Cells with an AND condition, or another alternative|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Count Cells with an AND condition, …
sp_PrintTopic sp_TopicIcon
Count Cells with an AND condition, or another alternative
Avatar
GaryTibble
Christchurch
Member
Members
Level 0
Forum Posts: 25
Member Since:
September 26, 2016
sp_UserOfflineSmall Offline
1
March 22, 2018 - 12:00 pm
sp_Permalink sp_Print

Hi

I would like to Count cells that meet two criteria.

Range 1 is F21:F20000

Criteria is "Done" (text value)

Range 2 is E21:E20000

Criteria is C7-7  (note that this is taking the date specified in C7, and subtracting 7 days)

I keep getting formula errors with whatever I try, even COUNTIFS, COUNTIF, COUNTIF combined with AND, etc..

Any assistance would be appreciated.

Thanks very much, Gary

sp_AnswersTopicSeeAnswer See Answer
Avatar
SunnyKow
Puchong, Malaysia

VIP
Members


Trusted Members
Level 8
Forum Posts: 1432
Member Since:
June 25, 2016
sp_UserOfflineSmall Offline
2
March 22, 2018 - 6:31 pm
sp_Permalink sp_Print

Hi Gary

C7-7 will only give you a date. What is the criteria that you want applied to the result? A certain date/month/year etc?

What are the actual formulas that you had tried? It would help if you can attach some sample.

Sunny

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 871
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
3
March 23, 2018 - 7:11 am
sp_Permalink sp_Print

Hello Gary,

There must be something wrong in your data or more likely, your file.
As I try to show with below picture, with the criterias you mention it works fine using COUNTIFS.

GaryTibble_Countif-1.JPGImage Enlarger

As you can see, the date in cell C2 is text, still COUNTIF and COUNTIFS take that text date as a date, removes 7 days and looks for date 2018-03-01 when counting. So even when "wrong" it works fine. I am using Excel from Office 365 subscription, I can't tell if there is a difference with other versions.

Good luck with finding the error. Try using the Error Checking -->Trace Error tool in Formulas tab.

Br,
Anders

sp_PlupAttachments Attachments
  • sp_PlupImage GaryTibble_Countif-1.JPG (64 KB)
Avatar
GaryTibble
Christchurch
Member
Members
Level 0
Forum Posts: 25
Member Since:
September 26, 2016
sp_UserOfflineSmall Offline
4
March 26, 2018 - 5:48 am
sp_Permalink sp_Print

Hi All

Thanks for the replies to date.

I have attached a copy of the original spreadsheet I am trying to rework and tidy up.

The issue I am trying to fix is the result of the formula in Cell H5 which refers to the date populated in Cell G6.

Kind Regards

Gary

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 871
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
5
March 26, 2018 - 7:00 am
sp_Permalink sp_Print sp_EditHistory

Hi Gary,

I have checked your file and the array formula you have in cell H5 works. In case you want to change and use COUNTIFS then you can use following formula.

=COUNTIFS($H$11:$H$65502,"Done",$G$11:$G$65502,">"&$G$6-7)

The result will be 4, as there are four rows that have status "Done" and have a due date greater than February 8, 2018.
Not sure if this what you are after, but I have based it on the current array formula in cell H5.

Br,
Anders

sp_AnswersTopicAnswer
Answers Post
Avatar
GaryTibble
Christchurch
Member
Members
Level 0
Forum Posts: 25
Member Since:
September 26, 2016
sp_UserOfflineSmall Offline
6
March 26, 2018 - 7:03 am
sp_Permalink sp_Print

Hi Anders

Thanks very much. I will check further and Yes it is what I am trying to achieve with a COUNTIFS statement.

My goal was to improve an old spreadsheet that had been created a long time ago by someone else.

Kind Regards

Gary

Avatar
GaryTibble
Christchurch
Member
Members
Level 0
Forum Posts: 25
Member Since:
September 26, 2016
sp_UserOfflineSmall Offline
7
March 26, 2018 - 7:18 am
sp_Permalink sp_Print

Hi Anders

I have used the formula you provided and it works well.

Thank you very much.

Regards, gary

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Kim Knox, Bhuwan Devkota
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 204
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Bhuwan Devkota
Kathryn Patton
Maria Conatser
Jefferson Granemann
Glen Coulthard
Nikki Fox
Rachele Dickie
Raj Mattoo
Mark Luke
terimeri dooriyan
Forum Stats:
Groups: 3
Forums: 24
Topics: 6221
Posts: 27285

 

Member Stats:
Guest Posters: 49
Members: 31909
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.