must be easy, trick

rplim2016

Board Regular
Joined
Jun 28, 2016
Messages
76
Hello Guys,



=IF(AND(CELL("format",A2)="D4",
CELL("format",B2)="D4",
CELL("format",C2)="D4",
CELL("format",D2)="D4"),
"is in DATE Format",)

above formula is to check if all values in A2 to D4 are in date.
my boss challenged me to simplify above formula.

please help me. :)
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Just tested again the Array Formula for you ...

https://www.mrexcel.com/forum/excel...ets-simple-count-post5247706.html#post5247706

And it does work ...

As an alternative ... a simple UDF can also perforrn the task ...

Code:
Function CountDates(rng As Range) As Long
Dim c As Range
Dim x As Long
  For Each c In rng
    If IsDate(c.Value) = True Then x = x + 1
  Next c
CountDates = x
End Function

P.S. For your info the Cell function does not accept an Array ...
 
Last edited:

rplim2016

Board Regular
Joined
Jun 28, 2016
Messages
76
Just tested again the Array Formula for you ...

https://www.mrexcel.com/forum/excel...ets-simple-count-post5247706.html#post5247706

And it does work ...

As an alternative ... a simple UDF can also perforrn the task ...

Code:
Function CountDates(rng As Range) As Long
Dim c As Range
Dim x As Long
  For Each c In rng
    If IsDate(c.Value) = True Then x = x + 1
  Next c
CountDates = x
End Function

P.S. For your info the Cell function does not accept an Array ...


Thanks a lot james!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,637
Messages
5,838,494
Members
430,550
Latest member
jmort

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top