ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Calculate only if... (https://www.excelbanter.com/excel-discussion-misc-queries/37092-calculate-only-if.html)

cribology - ExcelForums.com

Calculate only if...
 
Hi,

I currently have a spreadsheet that has this formula in the Q column.

=IF($D3=0,"",OR(NETWORKDAYS($D3,$F3)=1,+NETWORKDAY S($D3,$F3)=2))

It only calculates the networkdays if D3 is empty, but now I would
like it to calculate networkdays if both D3 and L3 is empty. How do I
adjust the formula to check the additional L3 cell?


cribology - ExcelForums.com

My bad, it seems that

=IF($D3*$L3=0,"",OR(NETWORKDAYS($D3,$F3)=1,+NETWOR KDAYS($D3,$F3)=2))

works just fine.


mcpie

try
=IF(AND($D3=0,$L3=0),"",OR(NETWORKDAYS($D3,$F3)=1, +NETWORKDAYS($D3,$F3)=2))

where the AND(... formula works in the same way as OR(...

"cribology - ExcelForums.com" wrote:

Hi,

I currently have a spreadsheet that has this formula in the Q column.

=IF($D3=0,"",OR(NETWORKDAYS($D3,$F3)=1,+NETWORKDAY S($D3,$F3)=2))

It only calculates the networkdays if D3 is empty, but now I would
like it to calculate networkdays if both D3 and L3 is empty. How do I
adjust the formula to check the additional L3 cell?



Bob Phillips

As NETWORKDAYS($D3,$F3)=1 will only be true if D3 and F3 are the same date,
why not use $D3=$F3

--
HTH

Bob Phillips

"mcpie" wrote in message
...
try

=IF(AND($D3=0,$L3=0),"",OR(NETWORKDAYS($D3,$F3)=1, +NETWORKDAYS($D3,$F3)=2))

where the AND(... formula works in the same way as OR(...

"cribology - ExcelForums.com" wrote:

Hi,

I currently have a spreadsheet that has this formula in the Q column.

=IF($D3=0,"",OR(NETWORKDAYS($D3,$F3)=1,+NETWORKDAY S($D3,$F3)=2))

It only calculates the networkdays if D3 is empty, but now I would
like it to calculate networkdays if both D3 and L3 is empty. How do I
adjust the formula to check the additional L3 cell?






All times are GMT +1. The time now is 02:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com