#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Complex formulas

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default Complex formulas

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.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Savio" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Complex formulas

its great thanks!
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 19
Default Complex formulas

is there any way to do the same using VBA?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help with some rather complex formulas... Dan B Excel Worksheet Functions 3 January 31st 07 05:40 PM
Need help with some rather complex formulas...... Dan B Excel Worksheet Functions 0 January 30th 07 10:01 PM
Need help with some rather complex formulas... Dan B Excel Worksheet Functions 3 January 30th 07 08:49 PM
Complex Formulas TiaB Excel Worksheet Functions 2 February 14th 06 04:03 AM
Complex If Then formulas Sneed924 Excel Worksheet Functions 1 June 2nd 05 04:22 PM


All times are GMT +1. The time now is 08:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"