Formula Help please...

How_Do_I

Well-known Member
Joined
Oct 23, 2009
Messages
1,831
Office Version
  1. 2010
Platform
  1. Windows
I've lost myself with this formula...

=IF(AND(AG$7>=$L9-DAY($L9)+1,AG$7<=$N9),IF(DATE(YEAR($L9),MONTH($L9),1)<=AG$7,IF($N9>=AG$7,1,0),0),"")

That formula wasn't working until I swopped the value if true and the value if false around...

However what I want is the formula not to calculate when the logical test is false...

So before the change of the value if true and value is false I had:

=IF(AND(AG$7>=$L8-DAY($L8)+1,AG$7<=$N8),"",IF(DATE(YEAR($L8),MONTH($L8),1)<=AG$7,IF($N8>=AG$7,1,0),0))

What should I use to have "" as value if true WHEN the logical test isn't true... Does that even make sense...!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Rich (BB code):
=IF(AND(AG$7>=$L9-DAY($L9)+1,AG$7<=$N9),IF(DATE(YEAR($L9),MONTH($L9),1)<=AG$7,IF($N9>=AG$7,1,0),0),"")

I'm not sure I follow what you are shooting for. Your formula has three IF statements. The last two seem to duplicate what the first IF(AND already does.

This is a guess; Try something like this...
Excel Formula:
=IF(AND(AG$7>=$L9-DAY($L9)+1,AG$7<=$N9), 1, "")
 
Upvote 0
=IF(AND(AG$7>=$L9-DAY($L9)+1,AG$7<=$N9), 1, "")

I've lost my way with the formula.... This seems to be working though but I'm not sure about the IF statements myself...

=IF(AND(AG$7>=$L8-DAY($L8)+1,AG$7<=$N8)=FALSE,"",IF(DATE(YEAR($L8),MONTH($L8),1)<=AG$7,IF($N8>=AG$7,1,0)))
 
Upvote 0
In Cell L8 downwards I have a start dates which aren't always the start of the month... In Cell N8 downwards I have end dates... Starting in AG7 I have month and year going across... I'm creating a GNATT Chart (think that's the name)...
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,039
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top