Search for price with date criteria

CESAREX

New Member
Joined
Jun 14, 2018
Messages
2
Hello everyone,


I need your help with a problem!

I have two spread sheet:


Cost&Price
uZMMV37.png



Sales
Y4pTvv4.png


When I type the product code in Sales spread sheet I need the Price to appear correctly, taking into account the Date (Sales) and Update_Dat (Cost&Price).

FYI: Concat = product_code;vector_dat

The flag does not matter in this function, I just need to know the active price as explained above. PROCV works when the date of sale coincides with the price update date, but for the others it presents an error.

I've tried several different operations, but I do not have much knowledge of index formula, etc.


If anyone can help, I will be very grateful.

Thanks in advance!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Try this:


Book1
ABCDEFGH
1ConcatUpdate_datVector_datProduct_codeProductCostPriceFlag
214316003/01/2018431601Cabernet Sauvignon$ 95.00$ 290.00Hist
324316003/01/2018431602Malbec$ 102.00$ 340.00Hist
434316003/01/2018431603Merlot$ 126.00$ 390.00Hist
544316003/01/2018431604Pinot Noir$ 80.00$ 170.00Hist
654316003/01/2018431605Chardonnay$ 120.00$ 380.00Hist
764316003/01/2018431606Tannat$ 228.00$ 540.00Act
834317403/15/2018431743Merlot$ 150.00$ 450.00Act
944317903/20/2018431794Pinot Noir$ 80.00$ 150.00Hist
1044318503/26/2018431854Pinot Noir$ 94.00$ 190.00Hist
1154319304/03/2018431935Chardonnay$ 135.00$ 390.00Act
1224319304/03/2018431932Malbec$ 91.00$ 340.00Act
1314321204/22/2018432121Cabernet Sauvignon$ 95.00$ 340.00Act
1444321204/22/2018432124Pinot Noir$ 80.00$ 170.00Hist
1544321804/28/2018432184Pinot Noir$ 91.00$ 185.00Act
Cost&Price



Book1
ABCDEFG
1Sale codeSale period codDateWeekendMonthProduct CodePrice
21101/03/2018Nao31$ 290.00
32101/03/2018Nao32$ 340.00
43202/03/2018Nao34$ 170.00
54404/03/2018Sim35$ 380.00
65505/03/2018Nao32$ 340.00
76909/03/2018Nao33$ 390.00
Sales
Cell Formulas
RangeFormula
G2{=INDEX('Cost&Price'!$G:$G,MAX(IF('Cost&Price'!$D:$D=$F2,IF('Cost&Price'!$B:$B<=$C2,ROW('Cost&Price'!$G:$G)))))}
Press CTRL+SHIFT+ENTER to enter array formulas.


WBD
 
Upvote 0
Hey

Unfortunately the formula does not work for me. I tried even just with the example I gave and it also did not work.

When I using Ctrl + Shift + Enter, Excel displays an error message and does not accept the formula.


Thank you anyway.
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,877
Members
449,056
Latest member
ruhulaminappu

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