0

I am trying to get the count of cells in a column containing dates having future date. The column values are in string format.

I have figured out the formula as :

=COUNTIF(G19:G31,">" & TODAY())

This function works when the column values are in date format. But its failing if the cell format is in string format.

I have figured out the formula to convert a cell string value to date :

=DATEVALUE(G19)

Here are my queries: 1) How to apply DATEVALUE on a range , in this case from G19:G31? 2) How to combine these two formulas in to one single formula?

1

2 Answers 2

1

You could use:

=SUMPRODUCT(--((G19:G31+0)>TODAY()))

COUNTIF will not accept anything other than a range as its first argument so you can't use functions there.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your help. This approach is working fine in case all the cells G19:G31 has data but giving Value error in case any of the cells is empty. Can we handle that?
Have you tried using an Iferror formula around what was provided above?
0

An alternative is to write =SUM(IF(DATEVALUE(G19:G31) > TODAY(), 1, 0))

But this will be an array formula: you need to press Ctrl + Shift + Return once you've done editing, rather than just Return.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.