Find Duplicate Values in Column, Return Time Between from Different Column

gdeboer

New Member
Joined
May 3, 2018
Messages
2
This is my first post so please bear with me. I am trying to use some data to pull the lifetime of lithium batteries that I use. My spreadsheet is set up as follows:

Column A: Object Battery is powering (Each object has a number)
Column B: Second Object Battery is powering (if applicable)
Column C: Battery Number (each battery has a number)
Column D: Date the battery was installed
Column E: Last used batter number in the object

I want to put a formula into column G for the following: Find duplicate numbers in column A, and return the distance between the dates in column D for the duplicates.

The hardest part is that there will often be multiple duplicates, and i need the distance between the NEXT duplicate in the row so that i can figure out how long my batteries in my devices are lasting so that i can project replacement costs.

Thank you for the help in advance!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Welcome to the board.

Maybe:

ABCDEFG
1Object2nd ObjectBattery #Date InstalledLast Battery #Difference
211-Jan3
322-Jan2
433-Jan2
514-Jan5
624-Jan
735-Jan
845-Jan
956-Jan4
1067-Jan
1178-Jan
1219-Jan
13510-Jan
14

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
G2=IFERROR(VLOOKUP(A2,A3:D100,4,0)-D2,"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Change the bottom end of the range so that it's after the end of your data.
 
Upvote 0
Eric,

Thank you so much sir! That worked and was just what I needed. Really appreciate it!
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

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