Below formula which works on excel 365 only, but also need to be work on excel 2021...

Status
Not open for further replies.

pankajgrover

Board Regular
Joined
Oct 27, 2022
Messages
157
Office Version
  1. 2021
Platform
  1. Windows
Here below is the formula i am using which works on excel 365 only, but also i need to work on excel 2021...
I think HSTACK function creating issue in 2021 excel, Kindly make it alternative formula ... Thanks...

Excel Formula:
=FILTER(HSTACK((INT(Table1[Date])),REPLACE(Table1[Stocks],1,4,""),Table1[[Qty]:[Price]]),(NOT(ISERROR(SEARCH(B2,Table1[Stocks])&(SEARCH(C2,(INT(Table1[Date])))&(SEARCH(D2,Table1[Buy/Sell]))))))*(INT(Table1[Date])>=IF(E2="",1/1/1900,E2))*(INT(Table1[Date])<=IF(H2="",TODAY(),H2))*((Table1[Price])<=IF(I2="","",I2))*((Table1[Price])>=IF(J2="",1,J2))*(Table1[Qty]<>""))

Shares Search Filter1.xlsx
ABCDEHIJ
1ParticularDateBuy/SellFrom DateTo DatePrice<=Price<=
2SEARCH
3
4220AVG1926.87
5DateParticularQtyBuy/SellPriceBalance Qty
606-08-2024MICROSOFT25BUY135.7056
706-08-2024SAMSUNG5BUY643.5011
806-08-2024NETFLIX11BUY3347.7062
906-08-2024APPLE50BUY287.0079
1006-08-2024MICROSOFT5SELL49899.9056
1106-08-2024SAMSUNG1BUY5187.7011
1206-08-2024NETFLIX25BUY135.8462
1306-08-2024APPLE25BUY287.8079
1406-08-2024MICROSOFT11BUY1610.6556
1506-08-2024SAMSUNG4BUY2651.6011
1606-08-2024NETFLIX1BUY2650.7562
1706-08-2024APPLE1SELL475.5079
1805-08-2024MICROSOFT25BUY649.3056
1905-08-2024SAMSUNG1BUY476.8511
2005-08-2024NETFLIX25BUY800.3062
2104-08-2024APPLE5BUY6536.3579
22 
Search
Cell Formulas
RangeFormula
C4C4=SUBTOTAL(9,C6:C1000)
E4E4=F4/C4
A6:E21A6=FILTER(HSTACK((INT(Table1[Date])),REPLACE(Table1[Stocks],1,4,""),Table1[[Qty]:[Price]]),(NOT(ISERROR(SEARCH(B2,Table1[Stocks])&(SEARCH(C2,(INT(Table1[Date])))&(SEARCH(D2,Table1[Buy/Sell]))))))*(INT(Table1[Date])>=IF(E2="",1/1/1900,E2))*(INT(Table1[Date])<=IF(H2="",TODAY(),H2))*((Table1[Price])<=IF(I2="","",I2))*((Table1[Price])>=IF(J2="",1,J2))*(Table1[Qty]<>""))
H6:H22H6=SUMIFS(Search!$C$6:$C$1000,Search!$B$6:$B$1000,B6,Search!$D$6:$D$1000,"BUY",Search!$G$6:$G$1000,1) - SUMIFS(Search!$C$6:$C$1000,Search!$B$6:$B$1000,B6,Search!$D$6:$D$1000,"SELL",Search!$G$6:$G$1000,1)
Dynamic array formulas.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Status
Not open for further replies.

Forum statistics

Threads
1,223,880
Messages
6,175,157
Members
452,615
Latest member
bogeys2birdies

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