Formula contains and ERROR???

L

Legacy 259187

Guest
Hello, I am trying to displace 3 different results, 0,1 or "", based on 4 arguments. The formula I am trying to do this with is =IF(AND(B$2>=Data!$L2,B$2<=Data!$W2),1,"",IF(AND (B$2>=Data!$M2,B$2<=Data!$P2),0,"")). Excel is telling me I an error. I must be missing something. This is for a gantt chart that I want to display results in a way that the chart tool cant help me with so I am having to try to build this from scratch. Looks like I have hit a wall. any help to point out the error here would be most appreciated.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Welcome to MrExcel.

If accepts only three arguments, not four like you have:

=IF(AND(B$2>=Data!$L2,B$2<=Data!$W2),1,IF(AND(B$2>=Data!$M2,B$2<=Data!$P2),0,""))
 
Upvote 0
I need to place the correct results in the correct location on the chart in order to use the conditional formating I need. If the first set agrees a "1" will be placed in the proper location. if the second set agrees then a "0" will be displayed, and if it is false then the cell is to be left blank. I can get either one or the other set by itself to work properly but both together does not work because of the 3 argument rule. is there any way to get around this?
 
Upvote 0
Yess!! it worked. eveidently i did not completely erase the old formula :p
 
Upvote 0
I guess I had too many "" in there. Thank you so much for the help :pray:
 
Upvote 0
Well.... after checking the results, I am getting all the "0" displayed but no "1". so it almost worked. I need the "1" take priority over the "0" because this will be the shorter range to be displayed. this all falls into a grid based on start and finish dates.
 
Upvote 0

Forum statistics

Threads
1,213,496
Messages
6,113,993
Members
448,539
Latest member
alex78

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