I have this formula, which works quite nicely
sum('usd begin:usd end'!m10)
to automate it, I started setting local names in the spreadsheet so I can use the sheet more than once.
so sheet1!currency=sheet1!$b$3 for example.
So in sheet 1, a made this formula