Formula to lookup stock and calculate dividends

NeoSez

Board Regular
Joined
Aug 14, 2020
Messages
246
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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,224,746
Messages
6,180,703
Members
452,994
Latest member
Janick

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