Formula to get data from a column based on a date range

Nowherefast

New Member
Joined
May 18, 2009
Messages
23
Hello:

I've been trying to create a formula to get the following info but have not had much luck.

I have 2 files and I need to populate the promo price from one file to another based on matching of the item number and then date range
See example below


ItemSale DateGet Promo PriceItemStart DateEnd DatePromo Price
11234/1/2018 1511231/1/20183/1/20185
5665 6/15/2018 null11233/15/20183/31/201810
11234/1/20186/1/201815
56651/1/20185/1/20183.99
56657/1/20189/1/20187.99

<colgroup><col><col><col><col span="2"><col span="2"><col><col></colgroup><tbody>
</tbody>
So I need to populate "Get promo price". In the example, for item 1123, it would be $15 and then for ITem 5665 it would be "null"

Hope I make sense?

Thank you.

<colgroup><col><col><col><col span="2"><col span="2"><col><col></colgroup><tbody>
</tbody>


<colgroup><col><col><col><col span="2"><col span="2"><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
This array formula might serve your purposes.


Book1
ABCDEFGH
1ItemSale DateGet Promo PriceItemStart DateEnd DatePromo Price
211234/01/181511231/01/183/01/185
356656/15/18011233/15/183/31/1810
411234/01/186/01/1815
556651/01/185/01/183.99
656657/01/189/01/187.99
Sheet32
Cell Formulas
RangeFormula
C2{=MAX((A2=$E$2:$E$6)*(B2>=$F$2:$F$6)*(B2<=$G$2:$G$6)*$H$2:$H$6)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi,

Another way:


Book1
ABCDEFGH
1ItemSale DateGet Promo PriceItemStart DateEnd DatePromo Price
211234/1/20181511231/1/20183/1/20185
356656/15/2018011233/15/20183/31/201810
411234/1/20186/1/201815
556651/1/20185/1/20183.99
656657/1/20189/1/20187.99
Sheet243
Cell Formulas
RangeFormula
C2=SUMPRODUCT((E$2:E$6=A2)*(F$2:F$6<=B2)*(G$2:G$6>=B2)*H$2:H$6)
 
Upvote 0
Also a SUMIFS option:


Book1
ABCDEFGH
1ItemSale DateGet Promo PriceItemStart DateEnd DatePromo Price
211234/1/20181511231/1/20183/1/20185
356656/15/2018011233/15/20183/31/201810
411234/1/20186/1/201815
556651/1/20185/1/20183.99
656657/1/20189/1/20187.99
Sheet243
Cell Formulas
RangeFormula
C2=SUMIFS(H$2:H$6,E$2:E$6,A2,F$2:F$6,"<="&B2,G$2:G$6,">="&B2)
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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