Using Excel to determine which row to choose

novodisc

New Member
Joined
Apr 6, 2006
Messages
16
Hello Excel experts out there,

I have multiple rows of data with same batch number & different end dates.
I want to be able to use Excel assign a weight to the row base on the latest end date.
After that, I want to pivot the data base on the weight assigned to it.

Pls see below for example.

Is there anyway to do this w/o using macro?
If macro is needed, how can i quote the macro?

Your help will be very much appreciated!

Thanks in advance for your response! :)

Eg:
Batch number Start Date End Date Weight
24689001 25/Mar/07 24/Mar/09 0
24689001 20/Mar/07 24/Mar/09 0
24689001 16/Apr/07 15/Apr/09 0
24689001 25/Mar/09 24/Mar/10 0
24689001 25/Mar/09 7/May/13 5
99987543 25/Mar/07 24/Mar/09 5
43452532 25/Mar/07 24/Mar/09 0
43452532 29/Mar/08 12/Dec/09 0
43452532 25/Mar/09 24/Mar/10 5
53246532 16/Apr/07 15/Apr/09 5
24689051 25/Mar/09 24/Mar/10 5
 
<br />
Book1
ABCD
1Batch numberStart DateEnd DateWeight
22468900125-Mar-0724-Mar-090
32468900120-Mar-0724-Mar-090
42468900116-Apr-0715-Apr-090
52468900125-Mar-0924-Mar-100
62468900125-Mar-097-May-135
79998754325-Mar-0724-Mar-095
84345253225-Mar-0724-Mar-090
94345253229-Mar-0812-Dec-090
104345253225-Mar-0924-Mar-105
115324653216-Apr-0715-Apr-095
122468905125-Mar-0924-Mar-105
Sheet1
Cell Formulas
RangeFormula
D2{=(MAX(IF($A$2:$A$12=A2,$C$2:$C$12))=C2)*5}
Press CTRL+SHIFT+ENTER to enter array formulas.


Copy the formula in D2 down column D

Or you could use this formula in D2 if the Batch numbers are always sorted and in chronological order.
=IF(A2=A3,0,5)
 
Upvote 0

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