# Whats wrong with this formula?

#### shinstrike

##### New Member
Hi, this is the formula am trying to work on:
=IF(VLOOKUP(N9,'National Holiday'!\$A\$1:\$A\$1000,1,FALSE),"HOLIDAY",AND(IF(WEEKDAY(N12,2)=1,"Mon",IF(WEEKDAY(N12,2)=2,"Tue",IF(WEEKDAY(N12,2)=3,"Wed",IF(WEEKDAY(N12,2)=4,"Thrs",IF(WEEKDAY(N12,2)=5,"Fri",IF(WEEKDAY(N12,2)=6,"Sat","Sun"))))))))

my aim is that if the date range fall into the vlookup, it will state holiday, but if it doesnt fall into the vlookup date range, it will state the day of that date.

The "HOLIDAY" will come out but the other name of the day won't come out, if it's not holiday, it just has #N/A as the result. I suppose it is something wrong wwith the AND, IF function.

Any help will be much appreciated

### 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
Try
=IF(ISNUMBER(MATCH(N9,'National Holiday'!\$A\$1:\$A\$1000,0)),"Holiday",TEXT(N9,"ddd"))

possibly

=IF(ISNA(VLOOKUP(N9,'National Holiday'!\$A\$1:\$A\$1000,1,FALSE)),TEXT(N9,"ddd"),"Holiday")

Try
=IF(ISNUMBER(MATCH(N9,'National Holiday'!\$A\$1:\$A\$1000,0)),"Holiday",TEXT(N9,"ddd"))

It works wonder Thankss alot mate :D
am still wondering why my formula doesnt work tho..

I am still wondering why my formula doesnt work tho..

probably because of the reason I stated in my post

Replies
15
Views
284
Replies
8
Views
566
Replies
0
Views
165
Replies
5
Views
179
Replies
8
Views
523

1,196,328
Messages
6,014,670
Members
441,835
Latest member
rthomas268

### 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.

### Which adblocker are you using?

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

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