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.
ID numberCar ModelPurchase DateSale Date
1234Skoda01/02/2017 08:0001/10/2017 16:00
1234Skoda01/10/2017 08:0002/10/2017 08:00

<tbody>
</tbody>


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

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Not quite sure what your expected outcome would look like, can you show some sample answers please?
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,015
Members
449,060
Latest member
LinusJE

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