How to combine data values using LOGIC (e.g.IF)

Curious_Data

New Member
Joined
Dec 11, 2016
Messages
1
Hi,

I'm new to this forum so hope this hasn't been asked before.

I have a large data set where I have rows that contain the same data on 2 columns. Let's call them ID number and Car Model. I only want to combine the rows IF ID + Car Make = ID + Car Make of another row (e.g. duplicate) AND the date of sale is within 1 day of the date of purchase of the other car.

If we combine these values I want the Earliest buy date to be kept and the Latest Sale Date to be kept.

e.g.[TABLE="width: 500"]
<tbody>[TR]
[TD]ID number[/TD]
[TD]Car Model[/TD]
[TD]Purchase Date[/TD]
[TD]Sale Date[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Skoda[/TD]
[TD]01/02/2017 08:00[/TD]
[TD]01/10/2017 16:00[/TD]
[/TR]
[TR]
[TD]1234[/TD]
[TD]Skoda[/TD]
[TD]01/10/2017 08:00[/TD]
[TD]02/10/2017 08:00[/TD]
[/TR]
</tbody>[/TABLE]


I've tried:
List ID number in order using Filter
Combine ID number and Car Model (CONTANTE) =CONTANTE(A2,B2)
New Column
=IF(C3-D2<=1, "True","False")
Then I highlight the duplicates (combined ID and Car Model) and if the first of the duplicates in "True" then I combine them.

All seems too complicated. Any help would be great!

Thanks
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Not quite sure what your expected outcome would look like, can you show some sample answers please?
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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