
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 10, 2023 08:51 AM
Hello,
how can I calculate the weighted average?
Example:
[-4, 0, 2, 0] -> I get this values via a roolup
I want the result to be -2 i.g.. Correct me please if I am wrong.
I'm open to use multiple formulas.
Best regards
Johannes
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 10, 2023 04:21 PM
Just to confirm are you looking for the average but only if the result is not 0?
If yes this has been solved over here:
https://community.airtable.com/t5/formulas/excluding-zero-values-from-an-average-rollup/td-p/26312
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 10, 2023 04:21 PM
Just to confirm are you looking for the average but only if the result is not 0?
If yes this has been solved over here:
https://community.airtable.com/t5/formulas/excluding-zero-values-from-an-average-rollup/td-p/26312

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 11, 2023 01:28 AM - edited Nov 11, 2023 01:50 AM
Hi @stevendasilva ,
thanks. I already saw the post. While reading the message more closely, I found out that it actually is the solution for my problem. However, there is no example, so I didn't figure it out the first time.
My solution was to return BLANK() instead of a 0, when the Formula encountered a BLANK() at the first or second value. If this is done, the AVERAGE() function of the Rollup skips these values.
- Values is the first table:
- Data: The data are either blanks or numbers from 1 to infinite. They represent "bad" and "good" occurrences.
- Formula: IF(AND({👍}=BLANK(), {👎}=BLANK()), BLANK(), IF({👍}=BLANK(),-{👎},IF({👎}=BLANK(),{👍},{👍}/({👎}+{👍}))))
- Rollup in the other table: IF(COUNTA(values)!=0, AVERAGE(values), BLANK())
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 13, 2023 10:09 AM
@Johannes_Strobe Awesome, nice work.
