Days between dates in rows

Jacobusn

New Member
Joined
Aug 20, 2023
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Hi
i want to calculate days between two dates if the serial number in a row is repeated in another row
can any one help me please
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
hi Pete
i have extracted the below from a report as the actual report is very large with multiple reference numbers.
from the below yuo can see i have a unique serial number. i have call dates and i have ticket numbers. i want to know what is the days between the call dates.
The data comes in rowes from the system and cant be changed to coloumns as the report will be to big
need a formula that looks at the unique serial number then deduact the dates from each other and places as per the manula examples in the last coloumn

can you help


Call ReferenceSerial NoCall DateDays since previous date device was serviced
GCN0501836​
UMZ01728​
2023-06-14 10:12:57​
GCN0511762​
UMZ01728​
2023-07-04 08:15:38​
20​
GCN0516946​
UMZ01728​
2023-07-12 12:19:23​
8​
GCN0521730​
UMZ01728​
2023-07-20 13:39:26​
8​
 
Upvote 0
Hi @Jacobusn

Assuming the following:
  1. Your data is sorted by "Serial No" and then by "Call Date"
  2. "Call Date" is a text string exactly formatted as in your example
  3. Your table is located in cells A1 to B5
Then the following formula would apply to the first cell of "Days since ...":

Excel Formula:
= IF($B1=$B2; DATEVALUE(LEFT($C2;10)) - DATEVALUE(LEFT($C1;10)); "")

If your data is not sorted, things get complex and beyond my knowledge.

One simple trick would be to sort your Excel sheet by those two columns using the Data tab on the ribbon.

Please let me know a little more on your data and if the formula helps.
 
Upvote 0
Hi @Jacobusn

Assuming the following:
  1. Your data is sorted by "Serial No" and then by "Call Date"
  2. "Call Date" is a text string exactly formatted as in your example
  3. Your table is located in cells A1 to B5
Then the following formula would apply to the first cell of "Days since ...":

Excel Formula:
= IF($B1=$B2; DATEVALUE(LEFT($C2;10)) - DATEVALUE(LEFT($C1;10)); "")

If your data is not sorted, things get complex and beyond my knowledge.

One simple trick would be to sort your Excel sheet by those two columns using the Data tab on the ribbon.

Please let me know a little more on your data and if the formula helps.
 
Upvote 0
Hi Pete
i will it a shot and let you know
sorting the data is not an issue, that’s doable
will the formula still work if some serials have 4 entries and some serial 2 Entries
thx
 
Upvote 0

Forum statistics

Threads
1,215,180
Messages
6,123,502
Members
449,100
Latest member
sktz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top