IF Error

P

PAL

I am trying to put a Year or blank in a field. I have to fields for a date:

H2 is Actual
G2 is Planned

I would like the Year from H2 in a C2; however if it is blank, I would like
it to look at G2 and populate the year in C2. If G2 is blank, I would like
C2 to be blank, but I get the "#Value!". I have tried 2 approaches that do
not seem to work.

=IF(H2>0,YEAR(H2),(IF(G2>0,YEAR(G2),"")))

and

=IF(H2>0,YEAR(H2),(IF(ISERROR(G2>0)),"",YEAR(G2))))

Lastly if it is not G1, I would like it to come up in red (trying to avoid
VB; formating is a nice to have only).

Thanks.
 
P

PCLIVE

For your second part, I'm assuming that you want cell C2 to be in Red if it
does not equal cell G1.
Use conditional formatting under the Format menu.

Cell Value Is
not equal to
=$G$1

Set your formatting.

Regards,
Paul



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

CountIf with And 0
Formula Help 3
formula 1
Date Formula 85 factor 7
IF AND statements 6
OR function 6
Conditional Formatting 4th Condition 3
If statement when two cells are the same 2

Top