How To Populate Last "N" Entries Conditionally?

xlmaniac

Well-known Member
Joined
Jul 2, 2009
Messages
527
Office Version
  1. 2010
Platform
  1. Windows
Dear All,
I do have a sample data-set across A1:C11 as follows.

SKULocationPosting Date
1A12-Jan
14-Jan
18-Jan
19-Jan
20-Jan
23-Jan
2D13-Dec
19-Dec
28-Dec
04-Jan

<tbody>
</tbody>

I would like to populate the last 3 posting date from the data set.
The desired result across F1:J3.
SKURegionLast Posting Date2nd Last Posting Date3rd Last Posting Date
1A23-Jan20-Jan19-Jan
2D04-Jan28-Dec19-Dec

<tbody>
</tbody>


Pls help in the formulae which can yield the desired result

Regards
Xlmainac
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You should first alter the data so that each record is complete, otherwise this is too difficult. It's also wise to have the dates display fully.

Copy row3 down as necessary for each SKU and Location.

ABCDEFGHIJ
1SKULocationPosting DateSKURegionLast Posting Date2nd Last Posting Date3rd Last Posting Date
21A1/12/181A1/23/181/20/181/19/18
31A1/14/182D1/04/1812/28/1712/19/17
41A1/18/18
51A1/19/18
61A1/20/18
71A1/23/18
82D12/13/17
92D12/19/17
102D12/28/17
112D1/04/18

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

Array Formulas
CellFormula
H2{=LARGE(IF(($F2=$A$2:$A$11)*($G2=$B$2:$B$11),$C$2:$C$11,""),1)}
I2{=LARGE(IF(($F2=$A$2:$A$11)*($G2=$B$2:$B$11),$C$2:$C$11,""),2)}
J2{=LARGE(IF(($F2=$A$2:$A$11)*($G2=$B$2:$B$11),$C$2:$C$11,""),3)}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
Thanks a lot for your help.
Really appreciate the same.
Regards
Xlmaniac
 
Upvote 0
Dear DRSteele,
I am getting the following error with the folrmula.
COuld you pls check once?

SKURegionLast Posting Date2nd Last Posting Date3rd Last Posting Date
1A01-12-2018#NUM!#NUM!
2D01-04-2018#NUM!#NUM!

Regards
Xlmaniac

<colgroup><col><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,752
Messages
6,126,672
Members
449,327
Latest member
John4520

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