Formula to lookup stock and calculate dividends

NeoSez

Board Regular
Joined
Aug 14, 2020
Messages
210
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
I am trying to figure out how to only look up ABC stock to calculate dividends only.
Column B: indicates whether it is DIV, BUY, SELL
Column C: name of stock (ABC stock)
Column J: $ amount
R3 = the lookup value aka stock
How do I change this current formula to only include DIV for ABC stock?
Excel Formula:
=SUM(VLOOKUP(R3,C2:J44,{8},1))
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
May be.
Combine column B&C, then track to row that matchs "DIV" & ABC stock, then get corresponding value in column J
Code:
=lookup(2,1/($B$2:$B$44&$C$2:$C$44="DIV"&R3),$J$2:$J$44)
LOOKUP function will get the last match, in case there are more than 1 match.
if you want to get the first match, try INDEX(MATCH instead
 
Upvote 0
It looks like a simple SUMIFS issue. Or did I get it wrong?
Excel Formula:
=SUMIFS(J2:J44,B2:B44,"DIV",C2:C44,$R$3)
 
Upvote 1
Solution
May be.
Combine column B&C, then track to row that matchs "DIV" & ABC stock, then get corresponding value in column J
Code:
=lookup(2,1/($B$2:$B$44&$C$2:$C$44="DIV"&R3),$J$2:$J$44)
LOOKUP function will get the last match, in case there are more than 1 match.
if you want to get the first match, try INDEX(MATCH instead
Thank you for your response @bebi021999. However, I found Flashbond's solution worked perfect for my needs.
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

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