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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,882
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?
 

Forum statistics

Threads
1,089,507
Messages
5,408,691
Members
403,224
Latest member
rholmesa

This Week's Hot Topics

  • help please
    SORRY NOT ANY GOOD AT EXCEL SO HELP WOULD BE MUCH APPRECIATED this formula is in a sheet called ignore...
  • two formulas needed
    Hello, I'll try my best to explain this: First formula needed in Sheet1 cell A2: If Sheet1 cell B2 = Sheet2 cell B2 then return a 1. If not then...
  • Dynamic Counts
    Good afternoon, we are tidying up some data & the data seems to be growing quicker than we are tidying it up! What we confirm (by reviewing it...
  • Help Excel formula eliminate duplicate values and keep only 2 identical rows.
    as picture below column A has a duplicate value. but the values are not the same as the rule. sometimes 4 rows, sometimes 10 rows or 7 or 9...
  • Macro Compile Error Sub or Function not defined
    Hello, I am trying to run macros from a validation list, all macros have been created and run perfectly on there own but I'm getting a compile...
  • Last row combined with Current Region VBA
    I'm generally happy finding the last row of data through something like Lastrow = Cells(Rows.Count, "D").End(xlUp) but I don't always receive data...
Top