Whats wrong with this formula?

shinstrike

New Member
Joined
Mar 20, 2013
Messages
4
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

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


Note, it didn't help your cause that you were using N9 in the Vlookup, but N12 in all your IF's...
 
Upvote 0
possibly

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


Note, it didn't help your cause that you were using N9 in the Vlookup, but N12 in all your IF's...
It works wonder :eek: Thankss alot mate :D
am still wondering why my formula doesnt work tho..
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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