May 14, 2020 02:47 AM
I am trying to understand a why a simple MOD function isn’t returning the correct answer.
Airtable works like a spreadsheet but gives you the power of a database to organize anything. Sign up for free.
On the table titled “SEASON STATS OVERVIEW”, in the OVER field, I am trying to build a larger formula and part of it requires me to use the MOD function. The formula in the OVERS field is MOD({BALLS BOWLED},6) but for some reason the record for player 2 is returning a value of 6 when it should be 0. I have tested the MOD function for the number 30 as a number i.e. not generated from a roll up function and that works. But for some reason when the number 30 is generated from a Roll up formula is returns an incorrect value.
I can grant creator access to you if you need to see the formula fields/
Any ideas/assistance, all gratefully received.
Thanks in advance
Solved! Go to Solution.
May 14, 2020 08:25 AM
@Justin_Barrett, it looks like the formula worked without needing to go through your workaround of converting the rollup field into a string, and then a value. Does this mean that Airtable now works properly when applying the “MOD” function to rollup fields?
May 14, 2020 08:29 AM
I don’t think it’s a case of it working properly “now” vs some other behavior in the past. My impression is that the output of a Rollup field depends on the aggregation formula used. It wouldn’t make sense for SUM(values)
to return an array. Same thing for MIN(values)
and MAX(values)
. However, some aggregation functions will still create arrays. In short, it’s a case-by-case situation.
May 14, 2020 08:32 AM
this is brilliant. thank you very much indeed.
May 14, 2020 08:33 AM
thank you as well for taking the time to figure out the solution. Again, much appreciated.
May 14, 2020 09:52 AM
Great, thank you! :slightly_smiling_face: