In a spreadsheet from work, prices per product per period are tracked. I want to create a table in which I state the price per product on 1 January and 1 July for each year (see image for a simplified example). For this I want to look up: 'if product name matches and date fall in between date range, take over accompanying price'. For this I intend to use INDEX+MATCH
. However, I keep getting errors after trying uncountable times.
For cell H3 (see image), I've tried using the following formula:
=iferror(index($D$2:$D$21,match(1;($G3=$A$2:$A$21)*(H$2>=$B$2:$B$21)*(H$2<=$C$2:$C$21;0)))
...and many variations of this formula (including small adaptation like changing ;
into ,
) in Excel 2016. I am aware that I should type Ctrl+Shift+Enter
since it's an array formula.
Could you please help my getting the formula right so it works in Excel?
Now I have tried the formula =iferror(index($D$2:$D$21;match(1;($G3=$A$2:$A$21)*(H$2>=$B$2:$B$21)*(H$2<=$C$2:$C$21);0)),"")
and still get an error. See screenshots with the code and with the error I get.
Any suggestions? The dates are in mm/dd/jjjj
format now.