# EOMONTH and WEEKDAY and add days

Hello, I have modified the EOMONTH formula with a WEEKDAY function. However, after I add WEEKDAY and add a parenth, the return is a date but it is in 1900 so I think I have done something wrong.  Do you see what is the issue?   I also want to add days to this formula and not certain where exactly to add the days.  The days added needs to also take into account if lands on a weekend then go to the next weekday.

this is how I have it now.  I added the WEEKDAY part.
=WEEKDAY(EOMONTH(H67,MOD(12-MONTH(H67),3)))
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SQL Server Data DudeCommented:
>EOMONTH and WEEKDAY and add days
Please explain in a format that Barney the Big Purple Dinosaur would understand what exactly you're trying to do here, as I can't see a question here.
Director, Practice Manager and Computing ConsultantCommented:
If you want to add days, you don't use the WEEKDAY function.

Your formula currently goes to the end of some month. If you want to add 10 days to the end, try:

=EOMONTH(H67,MOD(12-MONTH(H67),3)) + 10
Project financeAuthor Commented:
Jim,

How do I modify
=EOMONTH(H67,MOD(12-MONTH(H67),3))

for WEEKDAY

Project financeAuthor Commented:
Philip, I need to add WEEKDAY though.
Director, Practice Manager and Computing ConsultantCommented:
Why? What do you think WEEKDAY does (because it probably doesn't)?

WEEKDAY returns a number between 1 and 7.
Finance AnalystCommented:

=IF(WEEKDAY(EOMONTH(H67,MOD(12-MONTH(H67),3))<6,EOMONTH(H67,MOD(12-MONTH(H67),3)),EOMONTH(H67,MOD(12-MONTH(H67),3))+8-EOMONTH(H67,MOD(12-MONTH(H67),3)))

Thanks
Rob
Project financeAuthor Commented:
ahhhh I see why you are confused... I mean WORKWEEK.  I dont know the difference between the two as they seem to be the same to me.  anyways, the date needs to be M-F and not weekends and I need to add date criteria within that function.
Project financeAuthor Commented:
Rob, let me know if that changes something...didnt see your post.
Director, Practice Manager and Computing ConsultantCommented:
I think you mean WORKDAY:

=WORKDAY(EOMONTH(H67,MOD(12-MONTH(H67),3)) -1,1)
Project financeAuthor Commented:
OK and if I wanted to add a certain number of day where would I place that and still have the WORKDAY function apply?
Director, Practice Manager and Computing ConsultantCommented:
The last "1" is the number of days to add (less 1).

Currently, a Friday translates as a Friday. A Saturday or Sunday translates as a Monday.

If you want to add 5 working days, change it to:

=WORKDAY(EOMONTH(H67,MOD(12-MONTH(H67),3)) ,5)

If you wanted 5 calendar days, change it to:

=WORKDAY(EOMONTH(H67,MOD(12-MONTH(H67),3))+5 -1,1)

or

=WORKDAY(EOMONTH(H67,MOD(12-MONTH(H67),3))-1,1)+5

depending on your circumstances. The first one adds 5 calendar days, then moves it to the next working day. The second one moves it to the next working day, then adds 5 calendar days.

Experts Exchange Solution brought to you by