Complex formulas

S

Savio

I'm designing a spreadsheet to log specific details based on the
present date and time. Basically if an entry is logged on a day from
Mon-Fri before 5pm, then a cell value will have the present date. If
it is logged anytime on sat/sun the cell will have the next working
day (Monday) date. If an entry is logged after 5pm, Mon-Thurs, then
the next working day date is entered into the cell. For friday this
would mean Monday's date.
I have the individual formulas for each of these situations. However i
need to integrate the formulas into a user form so that all this is
done at the click of a button. Is there a simpler way to do this in
VBA or would i need to combine all the formulas into one and keep
pasting them into every cell that requires the data?
Thanks
 
S

Shane Devenshire

Hi,

Try this

=-(IF(AND(WEEKDAY(A1,2)<6,MOD(A1,1)>17/24),1,0)+WEEKDAY(A1,2)>6)+2*(IF(AND(WEEKDAY(A1,2)<6,MOD(A1,1)>17/24),1,0)+WEEKDAY(A1,2)>5)+A1

Where A1 contains the date and time logged.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top