Generally when writing formulas, if you are referencing a lookup field, a link row field, or using the lookup function you will always get back a list or array of values. To get this list down to a single value, like a single number, you need to use one of the aggregation functions like sum
.
There is a separate bug, where if you lookup a lookup field itself, you end up seeing a pile of JSON and you are not able to use aggregate functions on the lookup of a lookup. Please see this thread where I go into a workaround that can help in this situation until we fix this bug: Concat linked record showing [{"id": 2, "value": "CONTENTS"}]
If you have further questions, could you provide screenshots showing your exact table structure, and all of your formulas/lookups/link row fields?