if, lookups, checking if a cell value exists within another col, if so return value NEXT to that cell

ludo2016

New Member
Joined
May 9, 2016
Messages
10
I have two columns of dates and one column with prices.
The first column is a day by day sequence across the year (365 cells). The second column are the days when a transaction occurred (eg. 100 cells) and the third column is the transaction price on those days (100 cells).

I want to plot the transaction prices (yaxis) against the first column (x axis). For this I think I can formulate a function to allocate zeroes on the days when there was no transaction and prices on the days there were prices.

I've tried a combo of approaches, none of which have worked. Maybe there's an easier way? Or I'm tripping up in executing one of these approaches?: =vlookup(), if(vlookups), =IF(ISERROR(MATCH), and =IF(ISERROR(MATCH(A2,$C$2:$C$111,0)),"no match",VLOOKUP(A2,$C$2:$D$111,2,FALSE))

Sample data:

[TABLE="width: 353"]
<tbody>[TR]
[TD]Cal Yr[/TD]
[TD][/TD]
[TD]Trans date[/TD]
[TD][/TD]
[TD]Trans price[/TD]
[/TR]
[TR]
[TD="align: right"]01/05/2015[/TD]
[TD][/TD]
[TD]10/05/2015[/TD]
[TD][/TD]
[TD]7.46[/TD]
[/TR]
[TR]
[TD="align: right"]02/05/2015[/TD]
[TD][/TD]
[TD]11/05/2015[/TD]
[TD][/TD]
[TD]7.31[/TD]
[/TR]
[TR]
[TD="align: right"]03/05/2015[/TD]
[TD][/TD]
[TD]19/05/2015[/TD]
[TD][/TD]
[TD]7.62[/TD]
[/TR]
[TR]
[TD="align: right"]04/05/2015[/TD]
[TD][/TD]
[TD]19/05/2015[/TD]
[TD][/TD]
[TD]7.08[/TD]
[/TR]
[TR]
[TD="align: right"]05/05/2015[/TD]
[TD][/TD]
[TD]20/05/2015[/TD]
[TD][/TD]
[TD]7.93[/TD]
[/TR]
[TR]
[TD="align: right"]06/05/2015[/TD]
[TD][/TD]
[TD]23/05/2015[/TD]
[TD][/TD]
[TD]7.115[/TD]
[/TR]
</tbody>[/TABLE]
 
Hi,

Check if this is what you're after:


Excel 2016 (Windows) 64 bit
ABCD
1Cal YrTrans dateTrans price
21-5-201510-5-20157,460
32-5-201511-5-20157,310
43-5-201519-5-20157,620
54-5-201519-5-20157,080
65-5-201520-5-20157,930
76-5-201523-5-20157,1150
87-5-20150
98-5-20150
109-5-20150
1110-5-20157,46
1211-5-20157,31
1312-5-20150
1413-5-20150
1514-5-20150
1615-5-20150
1716-5-20150
1817-5-20150
1918-5-20150
200
Sheet1
Cell Formulas
RangeFormula
D11=IFERROR(INDEX($C$2:$C$7,MATCH(A11,$B$2:$B$7,0)),0)


HtH
 
Upvote 0
Thanks Joris. Looks like a neat solution on here but it's not working in my spreadsheet. I get zeroes all the way down

[TABLE="width: 278"]
<colgroup><col span="2"><col span="2"></colgroup><tbody>[TR]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I don't think I get zeroes becasue of this but I've noticed another potential problem. Sometimes I have two prices on the same date.
 
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