Firebase with external calculation

Hi guys, is it possible to get clients specific data from firebase send to google sheet, make some calculations and write the result back in firebase? If so, is google sheet the best way to do it?
I will have to do it with around 10k clients.

Might be better to use cloud functions within Firebase to do this

tks, I´ll look into it..