LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default Count difference in days input box

Thanks merjet,

Your post helped me to get exactly what I needed.

have a great day

thanks again
--
By persisting in your path, though you forfeit the little, you gain the
great.



"merjet" wrote:

Not knowing what you have outside A2:B2, I don't what your code is
trying to do after getting the Start Date and Finish Date. Maybe the
following will help. With the Start Date and Finish Date in A2 and B2,
enter the following formulas.
C2: =1+INT(B2-A2)
D2: =NETWORKDAYS(A2,B2)
E2: =IF(MOD(C2-
D2,2)=0,0.5*(C2+D2),IF(WEEKDAY(A2)=1,0.5*(C2+D2)+0 .5,0.5*(C2+D2)-0.5))

These will give the counts of days, weekdays, and days excluding
Saturdays, respectively.

If you want the VBA code for them, turn on the macro recorder. Or
after entering the formulas, you can get the VBA code with the macro
recorder on by selecting each cell, putting your cursor at the end of
the formula, and hitting the Enter key.

Hth,
Merjet




 
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
Count distinct days from two groups of days Colin Excel Worksheet Functions 4 February 17th 10 07:14 PM
Count Days more than 180 days prior to today Gregory Day Excel Worksheet Functions 4 March 28th 08 10:16 PM
When word says Install I want it count the days for 3 days w.o wee CYNTHIA Excel Worksheet Functions 1 March 23rd 08 05:28 AM
COUNT how many ROWS ago out of 10 days that the highest high in 10 days was made rhhince Excel Worksheet Functions 1 January 14th 07 09:56 PM
i have two days and i want the difference in days, months, year maja Excel Worksheet Functions 7 April 22nd 06 01:14 AM


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

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

About Us

"It's about Microsoft Excel"