I have created a spreadsheet to track my crypto portfolio.
Here is the simple view of the task, that I'm trying to solve:
I want to:
- Take the number (amount) from each cell (A3:C3)
- Take the Currency name (A2:C2) that is related to the number in A3:C3
- VLOOKUP the data for EACH currency (F2:F4) and "*" amount (A3:C3) and the current price (G2:G4) accordingly
- The final step is to Sum all multiplied values and return the TOTAL SUM
So, basically, it works for me if I use the formula like that in my original sheet:
=(O8*(VLOOKUP(O$1,AD$2:AE,2,FALSE)))+(P8*(VLOOKUP(P$1,AD$2:AE,2,FALSE)))+(Q8*(VLOOKUP(Q$1,AD$2:AE,2,FALSE)))+(R8*(VLOOKUP(R$1,AD$2:AE,2,FALSE)))+(S8*(VLOOKUP(S$1,AD$2:AE,2,FALSE)))+(T8*(VLOOKUP(T$1,AD$2:AE,2,FALSE)))+(U8/(VLOOKUP(U$1,AF$2:AG,2,FALSE)))+(W8*(VLOOKUP(W$1,AD$2:AE,2,FALSE)))+(X8*(VLOOKUP(X$1,AD$2:AE,2,FALSE)))+(Y8*(VLOOKUP(Y$1,AD$2:AE,2,FALSE)))
However, this is too long and I'd like to find a better way to do this function
The problem with the current formula is that if I add a new wallet/currency between A:C (according to the sample screenshot), the whole formula will break because it won't include a new value. That's why I'm looking for a better formula to be able to insert the new column between A:C (so it becomes A:D) and the total SUM works in a way =sum(A:D)
No matter, how many cells I insert between A:D, the final function will work
If I use the long function like above, I have to rewrite many other cells to include a new column function once I add a new column.
Please let me know if you have any questions.


