ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Subtracting Dates (https://www.excelbanter.com/excel-worksheet-functions/189329-subtracting-dates.html)

jaxstraww

Subtracting Dates
 
I have a worksheet with two date ranges in the following formats.

20070115 & 20070117 as an example. I need to fiind the days between each
item. What we have are discount dates and pay dates. Trying to find out +/-
days that they made their discount.

Pete_UK

Subtracting Dates
 
Assuming the two dates are in A1 and B1, put this in C1:

=DATE(LEFT(B1,4),MID(B1,5,2),RIGHT(B1,2))-
DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

Format C1 as a number with 0 dp.

Hope this helps.

Pete

On May 29, 7:05*pm, jaxstraww
wrote:
I have a worksheet with two date ranges in the following formats.

20070115 & 20070117 as an example. I need to fiind the days between each
item. What we have are discount dates and pay dates. Trying to find out +/-
days that they made their discount.



LanceB

Subtracting Dates
 
If these are excel dates formatted as indicated below then

a1-b1

if they are numbers than

=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))-DATE(LEFT(B1,4),MID(B1,5,2),RIGHT(B1,2))

"jaxstraww" wrote:

I have a worksheet with two date ranges in the following formats.

20070115 & 20070117 as an example. I need to fiind the days between each
item. What we have are discount dates and pay dates. Trying to find out +/-
days that they made their discount.


muddan madhu

Subtracting Dates
 
suppose in A1 = 20070115 & B1 = 20070117
then put in C1
=DAYS360(DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2)), DATE(LEFT(B2,4),MID(B2,5,2),RIGHT(B2,2)))



On May 29, 11:05*pm, jaxstraww
wrote:
I have a worksheet with two date ranges in the following formats.

20070115 & 20070117 as an example. I need to fiind the days between each
item. What we have are discount dates and pay dates. Trying to find out +/-
days that they made their discount.



muddan madhu

Subtracting Dates
 
sorry

C1
=DAYS360(DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)), DATE(LEFT(B1,4),MID(B1,5,2),RIGHT(B1,2)))

On May 29, 11:21*pm, muddan madhu wrote:
suppose in A1 = 20070115 & B1 = 20070117
then put in C1
=DAYS360(DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2)), DATE(LEFT(B2,4),MID(B2,5,*2),RIGHT(B2,2)))

On May 29, 11:05*pm, jaxstraww
wrote:



I have a worksheet with two date ranges in the following formats.


20070115 & 20070117 as an example. I need to fiind the days between each
item. What we have are discount dates and pay dates. Trying to find out +/-
days that they made their discount.- Hide quoted text -


- Show quoted text -



Reitanos

Subtracting Dates
 
If those are actual dates that have been formatted to look like 8
digit numbers then you can just subtract to find the difference. If,
however, you have typed in 8 digit number but are reading them as
dates then you are facing much more work to manage this.

On May 29, 2:05 pm, jaxstraww
wrote:
I have a worksheet with two date ranges in the following formats.

20070115 & 20070117 as an example. I need to fiind the days between each
item. What we have are discount dates and pay dates. Trying to find out +/-
days that they made their discount.



Rick Rothstein \(MVP - VB\)[_569_]

Subtracting Dates
 
You could do this...

=TEXT(B1,"0000-00-00")-TEXT(A1,"0000-00-00")

Make sure the cell is formatted as General or Number.

Rick


"jaxstraww" wrote in message
...
I have a worksheet with two date ranges in the following formats.

20070115 & 20070117 as an example. I need to fiind the days between each
item. What we have are discount dates and pay dates. Trying to find out
+/-
days that they made their discount.



Fred Smith[_4_]

Subtracting Dates
 
Muddan,

Days360 will not properly subtract (or add) dates, because it assumes 30
days per month. See the other reponses for valid solutions. If you are
looking to be of help to posters, test your suggestions to make sure they
work before posting them.

Regards,
Fred.

"muddan madhu" wrote in message
...
sorry

C1
=DAYS360(DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2)), DATE(LEFT(B1,4),MID(B1,5,2),RIGHT(B1,2)))

On May 29, 11:21 pm, muddan madhu wrote:
suppose in A1 = 20070115 & B1 = 20070117
then put in C1
=DAYS360(DATE(LEFT(A2,4),MID(A2,5,2),RIGHT(A2,2)), DATE(LEFT(B2,4),MID(B2,5,*2),RIGHT(B2,2)))

On May 29, 11:05 pm, jaxstraww
wrote:



I have a worksheet with two date ranges in the following formats.


20070115 & 20070117 as an example. I need to fiind the days between each
item. What we have are discount dates and pay dates. Trying to find out
+/-
days that they made their discount.- Hide quoted text -


- Show quoted text -




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

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