Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to count if cells contain any date/data in Excel?

Have you even met problems to count number of cells containing any date or data in a specific range in Excel? In this article, I will introduce ways to count if cells contain any date/data in Excel.

Count if cells contain any date in Excel

Count if cells contain any data with COUNTA function in Excel

Count and select cells if contains any data in a specified range (only one click)

Easily select and count any date cells if dates are between two dates in Excel

If you have Kutools for Excel installed, you can apply its Select Special Cells utility to quickly select and count any date cells if dates are in a certain date range. Full Feature Free Trial 60-day!

ad select date between two dates



This method will introduce a VBA Macro to count cells containing dates in a specific range in Excel.

Step 1: Open the Microsoft Visual Basic for Applications window with pressing the Alt + F11 keys at the same time.

Step 2: Click the Insert > Module, and then paste the following VBA code into the Module window:

VBA: Count if cells contain any date

Function TypeCell(pRange As Range) As Variant

Dim xArr() As Variant
Dim xRng As Range
Application.Volatile
ReDim xArr(pRange.Cells.Count - 1) As Variant
xCount = 0
For Each xRng In pRange
xArr(xCount) = VarType(xRng)
xCount = xCount + 1
Next
TypeCell = xArr
End Function

Step 3: In a blank cell enter the formula =SUM(IF(TypeCell(A1:E15)=7,1,0)), and then press the Ctrl + Shift + Enter keys in a meantime.

Note: In the formula of =SUM(IF(TypeCell(A1:E15)=7,1,0)), the A1:E15 is the specific range we will count number of cells containing dates, you can change it based on your needs.

Now you will get the number of cells containing dates in the specific range.


The COUNTA function will help you figure out the number of cells with any data in a specific range in Excel easily.

In a blank cell enter the formula =COUNTA(A1:E15), and press the Enter key. In the formula, the range A1:E15 is the specific range you will count numbers of cells with data, and you can change it as you need.

Note: After selecting the specific range, we can get the cell number with any data in the Status Bar easily too.

 


If you have Kutools for Excel installed, you can apply its Select Nonblank Cells utility to count and select cells if contains any data quickly in a certain range with only one click.

Kutools for Excel - Combines more than 300 Advanced Functions and Tools for Microsoft Excel

Select the range you will count cells if contain any data, and click Kutools > Select > Select Nonblank Cells. See screenshot:

doc countif data 1

And then all cells with data in the specified range are selected, and a dialog box will pop up and show how many nonblank cells have been selected. See screenshot:

doc countif data 2

Kutools for Excel - Includes more than 300 handy Excel tools. Full feature free trial 60-day, no credit card required! Get it now!

Click the OK button to close this dialog box.


In this Video, the Kutools tab and the Kutools Plus tab are added by Kutools for Excel. If need it, please click here to have a 60-day free trial without limitation!



Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.