#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PAL PAL is offline
external usenet poster
 
Posts: 200
Default IF Error

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(H20,YEAR(H2),(IF(G20,YEAR(G2),"")))

and

=IF(H20,YEAR(H2),(IF(ISERROR(G20)),"",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.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default IF Error

Maybe this:

=IF(H2="",IF(G2="","",G2),H2)

HTH,
Paul

--

"PAL" wrote in message
...
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(H20,YEAR(H2),(IF(G20,YEAR(G2),"")))

and

=IF(H20,YEAR(H2),(IF(ISERROR(G20)),"",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.




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default IF Error

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



--

"PCLIVE" wrote in message
...
Maybe this:

=IF(H2="",IF(G2="","",G2),H2)

HTH,
Paul

--

"PAL" wrote in message
...
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(H20,YEAR(H2),(IF(G20,YEAR(G2),"")))

and

=IF(H20,YEAR(H2),(IF(ISERROR(G20)),"",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.






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PAL PAL is offline
external usenet poster
 
Posts: 200
Default IF Error

You nailed it. THanks.

"PCLIVE" wrote:

Maybe this:

=IF(H2="",IF(G2="","",G2),H2)

HTH,
Paul

--

"PAL" wrote in message
...
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(H20,YEAR(H2),(IF(G20,YEAR(G2),"")))

and

=IF(H20,YEAR(H2),(IF(ISERROR(G20)),"",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.





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default IF Error

=IF(H2,H2,IF(G2,G2,""))


"PAL" wrote:

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(H20,YEAR(H2),(IF(G20,YEAR(G2),"")))

and

=IF(H20,YEAR(H2),(IF(ISERROR(G20)),"",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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: "Excel encountered an error and had to remove some formatti Carl Excel Discussion (Misc queries) 0 September 18th 06 06:39 PM
Counting instances of found text (Excel error? Or user error?) S Davis Excel Worksheet Functions 5 September 12th 06 04:52 PM
I have Error 1919 Error Configuring ODBC dataSource Database Texanna1 Excel Discussion (Misc queries) 1 September 12th 06 06:35 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM


All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"