Robert Grootjen
Robert Grootjen

Reputation: 197

How can I remove/hide formula if cell is blank?

It's me again, your old pal.

I'm trying to get the latest date from 2 cells(please see example below) when COL B and COL C is 0 or blank it's still showing 12/30/1899 00:00:00 on COL D.

The formula I'm currently using:

=iferror(max(ARRAYFORMULA(B2:C2)))

It's all dynamic

B2                     C2               D2

Finance date           Project date     Max date
01/01/2020             01/05/2020       01/05/2020 01:00:35
(BLANK)                (BLANK)          12/30/1899 00:00:00 < (I want to show blank here)

What's the formula if COL B and COL C are blank to not run formula or show a blank?

Upvotes: 0

Views: 295

Answers (1)

carlesgg97
carlesgg97

Reputation: 4440

You cannot use =IFERROR() in this case since the =MAX() function will return 0 when both cells are empty, instead of returning an error.

Some of the possible solutions:

  1. =IF(OR(B2="", C2=""), "", MAX(B2:C2))
  2. =IF(MAX(B2:C2)=0, "", MAX(B2:C2))

Happy brogramming!

Reference

Upvotes: 2

Related Questions