Joining two IF/ AND statements

Anthea

New Member
Joined
Apr 5, 2011
Messages
13
I am trying to join two statements but keep getting errors. Please could someone help me and explain how to join them into one statement? Both Statements work correctly on their own

=IF(AND(A12>=$K$3,A12<=$L$3),"Sunday",(TEXT(A12,"dddd")))
=IF(AND(A12>=$K$4,A12<=$L$4),"Sunday",(TEXT(A12,"dddd")))

[TABLE="width: 450"]
<tbody>[TR]
[TD]ROW/ COLUMN[/TD]
[TD]Column A[/TD]
[TD]Column K[/TD]
[TD]Column L[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD="colspan: 2"]LEAVE[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD]START[/TD]
[TD]END[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD="align: right"]2018/03/05[/TD]
[TD="align: right"]2018/03/24[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD][/TD]
[TD="align: right"]2018/12/16[/TD]
[TD="align: right"]2019/01/02[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD]Thu 2018/03/01[/TD]
[TD]Thursday[/TD]
[TD]Thursday[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD]Fri 2018/03/02[/TD]
[TD]Friday[/TD]
[TD]Friday[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD]Sat 2018/03/03[/TD]
[TD]Saturday[/TD]
[TD]Saturday[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD]Sun 2018/03/04[/TD]
[TD]Sunday[/TD]
[TD]Sunday[/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD]Mon 2018/03/05[/TD]
[TD]Sunday[/TD]
[TD]Monday[/TD]
[/TR]
[TR]
[TD="align: right"]17[/TD]
[TD]Tue 2018/03/06[/TD]
[TD]Sunday[/TD]
[TD]Tuesday[/TD]
[/TR]
[TR]
[TD="align: right"]18[/TD]
[TD]Wed 2018/03/07[/TD]
[TD]Sunday[/TD]
[TD]Wednesday[/TD]
[/TR]
[TR]
[TD="align: right"]19[/TD]
[TD]Thu 2018/03/08[/TD]
[TD]Sunday[/TD]
[TD]Thursday[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD]Fri 2018/03/09[/TD]
[TD]Sunday[/TD]
[TD]Friday[/TD]
[/TR]
[TR]
[TD="align: right"]21[/TD]
[TD]Sat 2018/03/10[/TD]
[TD]Sunday[/TD]
[TD]Saturday[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
OR would be this for example:

=IF(OR(AND(A12>=$K$3,A12<=$L$3),AND(A12>=$K$4,A12<=$L$4)),"Sunday",(TEXT(A12,"dddd")))
 
Upvote 0
Thank you so much ... that is exactly what I was looking for. I tried the 'or' instead of the 'and' but never thought to put them together
:)
 
Upvote 0
To include all the cells K3 to L11 would I just expand the references for Column K from K3 to K11 and the same for Column L or is there a more elegant way of referencing those cells?
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

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