Sam
Sam

Reputation: 736

Writing a COUNTIFS with a date value

I have a COUNTIFS and I want to say "Count if date >= "value in cell B4"

so lets say I have something like

=COUNTIFS(MySheet!C:C,"Y",MySheet!D:D,">=B4")

It obviously does not recognise that it is looking for a date in cell B4 and therefore I get 0 as a result.

What syntax should I use so it recognises that I am looking for anything where the date is greater to the date in cell B4?

Upvotes: 1

Views: 399

Answers (1)

ed2
ed2

Reputation: 1497

Solution

=COUNTIFS(MySheet!C:C,"Y",MySheet!D:D,">="&B4)

Reason

Anything you enclose in quotes ("") is taken as a string literal. So it was looking to see cells whose value was ">=B4", instead of cells whose value was greater than the value in cell B4.

Upvotes: 2

Related Questions