#1   Report Post  
JN
 
Posts: n/a
Default IF function

Hi,

I have this formula in Excel, but it only works in some cases, not all. I
can't figure out why, maybe someone can help me with this.

IF(ISERROR(IF(OR(AG2<0,AE2<DATEVALUE("01/01/05"),AE2<="07/01/05"),0,AG2*NETWORKDAYS($B$265,MIN(AE2,DATEVALUE("1 2/31/05")))/NETWORKDAYS("07/29/05",AE2))),0,IF(OR(AG2<0,AE2<DATEVALUE("1/1/05"),AE2<="07/29/05"),0,AG2*NETWORKDAYS("07/29/05",MIN(AE2,DATEVALUE("12/31/05")))/NETWORKDAYS("07/29/05",AE2)))

Thanx!

  #2   Report Post  
bj
 
Posts: n/a
Default

When do you get errors?

"JN" wrote:

Hi,

I have this formula in Excel, but it only works in some cases, not all. I
can't figure out why, maybe someone can help me with this.

IF(ISERROR(IF(OR(AG2<0,AE2<DATEVALUE("01/01/05"),AE2<="07/01/05"),0,AG2*NETWORKDAYS($B$265,MIN(AE2,DATEVALUE("1 2/31/05")))/NETWORKDAYS("07/29/05",AE2))),0,IF(OR(AG2<0,AE2<DATEVALUE("1/1/05"),AE2<="07/29/05"),0,AG2*NETWORKDAYS("07/29/05",MIN(AE2,DATEVALUE("12/31/05")))/NETWORKDAYS("07/29/05",AE2)))

Thanx!

  #3   Report Post  
JN
 
Posts: n/a
Default

The formula doesn't work for years 19XX -2003. Based on the formula, it
should be 0. However, they are showing up with negative numbers.

JN


"bj" wrote:

When do you get errors?

"JN" wrote:

Hi,

I have this formula in Excel, but it only works in some cases, not all. I
can't figure out why, maybe someone can help me with this.

IF(ISERROR(IF(OR(AG2<0,AE2<DATEVALUE("01/01/05"),AE2<="07/01/05"),0,AG2*NETWORKDAYS($B$265,MIN(AE2,DATEVALUE("1 2/31/05")))/NETWORKDAYS("07/29/05",AE2))),0,IF(OR(AG2<0,AE2<DATEVALUE("1/1/05"),AE2<="07/29/05"),0,AG2*NETWORKDAYS("07/29/05",MIN(AE2,DATEVALUE("12/31/05")))/NETWORKDAYS("07/29/05",AE2)))

Thanx!

  #4   Report Post  
bj
 
Posts: n/a
Default

I don't know what is happening,
but you could try
=if(AE2=datevalue("7/29/05"),0,max(0,AG2*NETWORKDAYS("07/29/05",MIN(AE2,DATEVALUE("12/31/05")))/NETWORKDAYS("07/29/05",AE2)))
instead
"JN" wrote:

The formula doesn't work for years 19XX -2003. Based on the formula, it
should be 0. However, they are showing up with negative numbers.

JN


"bj" wrote:

When do you get errors?

"JN" wrote:

Hi,

I have this formula in Excel, but it only works in some cases, not all. I
can't figure out why, maybe someone can help me with this.

IF(ISERROR(IF(OR(AG2<0,AE2<DATEVALUE("01/01/05"),AE2<="07/01/05"),0,AG2*NETWORKDAYS($B$265,MIN(AE2,DATEVALUE("1 2/31/05")))/NETWORKDAYS("07/29/05",AE2))),0,IF(OR(AG2<0,AE2<DATEVALUE("1/1/05"),AE2<="07/29/05"),0,AG2*NETWORKDAYS("07/29/05",MIN(AE2,DATEVALUE("12/31/05")))/NETWORKDAYS("07/29/05",AE2)))

Thanx!

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
I NEED HELP with the SPELLNUMBER Function vag Excel Worksheet Functions 0 June 21st 05 08:17 AM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM


All times are GMT +1. The time now is 08:13 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"