Formula to lookup stock and calculate dividends

NeoSez

Board Regular
Joined
Aug 14, 2020
Messages
244
Office Version
  1. 365
  2. 2019
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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,223,704
Messages
6,173,984
Members
452,540
Latest member
haasro02

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