Weekday formula problems

jrschaef

New Member
Joined
May 29, 2003
Messages
12
I have entered a formula and it works fine in my excel sheet that I have saved, but when I send it out to others through email and they open the sheet the formula gives the a #NAME error. Why would this be and what do I need to solve this?

The formula is

=Weekday(Today(),-1)
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
What I'm trying to get with this function is the last weekday. I used to use Today()-1, but this does not work on Mondays. It returns Sundays date, and I want it to return Fridays (the last workday). That's why I was using the -1. What should I use instead of this? And actually now that I look at my formula, I did use workday vs weekday.

Thanks,
Jamie
 
Upvote 0
It sounds like you may actually want the WORKDAY function, i.e.

=WORKDAY(TODAY(),-1)
will give you the date of yesterday's workday

If you want it in the WEEKDAY format, use:
=WEEKDAY(WORKDAY(TODAY(),-1))

Be sure to have the Analysis Tool-Pak add-in loaded and enabled to use this function.
 
Upvote 0
=IF(ISERROR(VLOOKUP(WEEKDAY(TODAY(),1)-1,C2:D8,2,FALSE)),"Sat",VLOOKUP(WEEKDAY(TODAY(),1)-1,C2:D8,2,FALSE))

with a vlookup table of
1... Sun
2... Mon
3... Tue
4... Wed
5... Thur
6... Fri
7... Sat

This should give you the results you are looking for.
 
Upvote 0

Forum statistics

Threads
1,214,840
Messages
6,121,895
Members
449,058
Latest member
Guy Boot

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