Convert Google Sheet formula to Excel

mr_alok

New Member
Joined
Mar 30, 2021
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
How can I convert the following Google Sheet formula to Excel?
Iferror(index(arrayformula(filter(TX!L:L,TX!C:C<>"",row(TX!C:C)=max(if(TX!C:C=B2,row(TX!C:C),0)))) ,1),0)
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi & welcome to MrExcel.
Can you post some sample data, along with expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Hi & welcome to MrExcel.
Can you post some sample data, along with expected results.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

Thanks for guiding. I've attached the sheet below.

In Portfolio sheet, I need Cumulative Value (column M) and Cumulative Cost (Column R) for each ticker from Tx sheet.
e.g. for AAPL, the last transaction is in Row 8, as such Cumulative Value for AAPL is 13 (M8), and Cumulative Cost is 2673.15 (R8)
for NVDA, the last transaction is in Row 7, as such the Cumulative Value for NVDA is 5 (M7), and CUmulative Cost is 2537.15 (M7)

In case my Tx grows in future with other stocks, how can I pull all the unique Ticker symbols from Tx sheet to Portfolio sheet.
e.g. If I add a new row as MSFT in Tx, the ticker should appear in B4 together with respective Cumulative Values and Cumulative Cost.

Portfolio.xlsx
ABCDEFGHIJKLMNOPQRS
1NoExchangeDateTickerTrading PairTx TypeUnitsPrice per UnitFeeFee CurrencyPrev RowPrev UnitsCumulative UnitsTransacted ValuePrevious CostTransaction CostTransaction Cost (per unit)Cumulative CostGain/Loss fromSale
21NYSE08/03/2021AAPLUSDBUY15.00116.834.00USD00.0015.001752.450.00--1752.450.00
32NYSE09/03/2021NVDAUSDBUY10.00494.434.00USD00.0010.004944.300.00--4944.300.00
43NYSE18/03/2021NVDAUSDBUY10.00520.434.00USD310.0020.005204.304944.30--10148.600.00
54NYSE19/03/2021AAPLUSDBUY20.00120.214.00USD215.0035.002404.201752.45--4156.650.00
65NYSE22/03/2021AAPLUSDSELL25.00123.794.00USD535.0010.003094.754156.652969.04118.761187.61125.71
76NYSE22/03/2021NVDAUSDSELL15.00535.394.00USD420.005.008030.8510148.607611.45507.432537.15419.40
87NYSE25/03/2021AAPLUSDBUY3.00495.184.00USD610.0013.001485.541187.61--2673.150.00
Tx


Portfolio.xlsx
ABCD
1S.NoTickerCumulative UnitsCumulative Cost
21AAPL13.002673.15
32NVDA5.002537.15
Portfolio
 
Upvote 0
Thanks for that, how about
+Fluff 1.xlsm
ABCD
1S.NoTickerCumulative UnitsCumulative Cost
21AAPL132673.154286
32NVDA52537.15
4   
5   
6   
Data
Cell Formulas
RangeFormula
B2:B6B2=IFERROR(INDEX(TX!$D$2:$D$100,AGGREGATE(15,6,(ROW(TX!$D$2:$D$100)-ROW(TX!$D$2)+1)/(TX!$D$2:$D$100<>"")/(ISNA(MATCH(TX!$D$2:$D$100,B$1:B1,0))),1)),"")
C2:C6C2=IF(B2="","",INDEX(TX!$M$2:$M$100,AGGREGATE(14,6,(ROW(TX!$D$2:$D$100)-ROW(TX!$D$2)+1)/(TX!$D$2:$D$100=B2),1)))
D2:D6D2=IF(B2="","",INDEX(TX!$R$2:$R$100,AGGREGATE(14,6,(ROW(TX!$D$2:$D$100)-ROW(TX!$D$2)+1)/(TX!$D$2:$D$100=B2),1)))
 
Upvote 0
Solution
Thanks @Fluff it works!
How about if I want to sort column B (portfolio tab) based on Ticker symbols?
 
Upvote 0
I'm afraid I don't know how to do that with the 2016 version of Excel.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,585
Members
448,972
Latest member
Shantanu2024

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