ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   FORMULA NEEDED TO COUNT DAYS IN EXCEL BETWEEN DATES (https://www.excelbanter.com/excel-worksheet-functions/68258-formula-needed-count-days-excel-between-dates.html)

Rhonda1

FORMULA NEEDED TO COUNT DAYS IN EXCEL BETWEEN DATES
 
I have two questions. I have three columns that will have a calendar date in
them. On the fourth column, I need to put in a formula that will count the
days of the previous three columns. I can't seem to find the function that
will do this for me.

Second question I need a formula that will calculate the hours it took to
complete the tasks. i.e. convert the number of days into hours.

Also, one more...is there a way that once data is placed into one
cell....the cell in the column on the right will automatically configure the
current date?

Thanks!
Rhonda

Anne Troy

FORMULA NEEDED TO COUNT DAYS IN EXCEL BETWEEN DATES
 
1. So you want to add the days between the first and second column to the
number of days between the second and third column? Assuming the 2nd
column's dates fall after the first, and the 3rd after the 2nd, why not:
=(A2-B2)+(C2-B2)
2. Assuming the formula above is in D2, to get the hours:
=D2/24
3. Assuming you want to show a date in column B only if there is a value in
column C, try this:
=IF(ISBLANK(C2),"",TODAY())
However, the above formula will calculate and return "today" always.
************
Hope it helps!
Anne Troy
www.OfficeArticles.com

"Rhonda1" wrote in message
...
I have two questions. I have three columns that will have a calendar date
in
them. On the fourth column, I need to put in a formula that will count the
days of the previous three columns. I can't seem to find the function that
will do this for me.

Second question I need a formula that will calculate the hours it took to
complete the tasks. i.e. convert the number of days into hours.

Also, one more...is there a way that once data is placed into one
cell....the cell in the column on the right will automatically configure
the
current date?

Thanks!
Rhonda




vezerid

FORMULA NEEDED TO COUNT DAYS IN EXCEL BETWEEN DATES
 
Given two dates, you can find the number of days between them by simple
subtraction. However, it is best to enclose the difference in the
VALUE() functino, because otherwise Excel tends to format the result as
date:

=VALUE(B2-A2)

On your second question: You do not specify whether you record time. It
seems you only record dates. Then, the formula needed is probably:

=VALUE(B2-A2)*8

assuming that a working day has 8 hours.

For quick date/time entry you can use the combinatinos Ctrl+; (which
will enter the current date) and Shift+Ctrl+; (which will enter the
current time).

For further automation, let us assume that your data are to be entered
in column C:C and the data entry time in Column D:D. Then the following
event macro will automate this process:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C:C")) Is Nothing Then
Cells(Target.Cells(1,1).Row, Target.Cells(1,1).Column+1) = Format(Now,
"dd-mm-yyyy hh:mm")
End If
End Sub

Notice:
Change the construct "C:C" to whatever column is to hold data entry.
The row that starts with "Cells(" is to be a single line with hh:mm")
To install:
Right-click the sheet tab, select View Code, which will bring you to
VBA.
Paste the above code after possibly changing something.

HTH
Kostis Vezerides


Rhonda1

FORMULA NEEDED TO COUNT DAYS IN EXCEL BETWEEN DATES
 
Thank you to both! You have helped tremendously! Something so simple suddenly
bacame so complicated, and then suddenly so simple again! Thank you!

"Rhonda1" wrote:

I have two questions. I have three columns that will have a calendar date in
them. On the fourth column, I need to put in a formula that will count the
days of the previous three columns. I can't seem to find the function that
will do this for me.

Second question I need a formula that will calculate the hours it took to
complete the tasks. i.e. convert the number of days into hours.

Also, one more...is there a way that once data is placed into one
cell....the cell in the column on the right will automatically configure the
current date?

Thanks!
Rhonda


Anne Troy

FORMULA NEEDED TO COUNT DAYS IN EXCEL BETWEEN DATES
 
You're welcome, Rhonda! :) So glad we could help.
************
Anne Troy
www.OfficeArticles.com

"Rhonda1" wrote in message
...
Thank you to both! You have helped tremendously! Something so simple
suddenly
bacame so complicated, and then suddenly so simple again! Thank you!

"Rhonda1" wrote:

I have two questions. I have three columns that will have a calendar
date in
them. On the fourth column, I need to put in a formula that will count
the
days of the previous three columns. I can't seem to find the function
that
will do this for me.

Second question I need a formula that will calculate the hours it took
to
complete the tasks. i.e. convert the number of days into hours.

Also, one more...is there a way that once data is placed into one
cell....the cell in the column on the right will automatically configure
the
current date?

Thanks!
Rhonda





All times are GMT +1. The time now is 10:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com