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")))

ROW/ COLUMNColumn AColumn KColumn L
1LEAVE
2STARTEND
32018/03/052018/03/24
42018/12/162019/01/02
5
6
7
8
9
10
11
12Thu 2018/03/01ThursdayThursday
13Fri 2018/03/02FridayFriday
14Sat 2018/03/03SaturdaySaturday
15Sun 2018/03/04SundaySunday
16Mon 2018/03/05SundayMonday
17Tue 2018/03/06SundayTuesday
18Wed 2018/03/07SundayWednesday
19Thu 2018/03/08SundayThursday
20Fri 2018/03/09SundayFriday
21Sat 2018/03/10SundaySaturday

<tbody>
</tbody>
 
Last edited:

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,053
Office Version
365
Platform
Windows
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")))
 

Anthea

New Member
Joined
Apr 5, 2011
Messages
13
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
:)
 

Anthea

New Member
Joined
Apr 5, 2011
Messages
13
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?
 

Watch MrExcel Video

Forum statistics

Threads
1,095,199
Messages
5,442,992
Members
405,212
Latest member
Arnie58

This Week's Hot Topics

  • Copy entire row if CountA <>0 to another sheet
    [B]I want to copy entire row if CountA <>0 for column J7:AM7 (headers on J6:AM6) and so on till the last used cell is column D and paste the...
  • Select last used Row in Table
    I have created a Table in a Worksheet which is locked to prevent user errors and protect formula. Some of the cells require freetext entries which...
  • excel workbook: do not allow certain file name
    Hello all, Don't think this has ever been asked before, but how do I restrict file save [Before_Save Event] if the name of the file being saved...
  • fixing problem autofilter
    hello i need help about my code when i search by code in textbox it doesn't show anything this is my data [ATTACH type="full"...
  • “Weight”
    Hi, i’ve got a long sheet filled with weights such as kg,g,L & ml. i can build a formula to convert kg into g and liter into ml. How ever, my...
  • How to capitalize everything before a certain character?
    In column A, I have some text: Hello good day.mp3 Hello good day.flac etc. I'd like to capitalize everything before the period. I don't need the...
Top