Doing math on multiple columns

I have several columns that take in minutes and converts them to hours:minutes format. Now about 4-6 columns are formatted data using the math FLOOR(T/60) for the hour and MOD(T,60) for the minutes. Here’s what I want to do I want to be able to replace T with the 4-6 columns take in minutes as input without having to create a separate math column for each one is there a shortcut around this?

If you need me to explain more let me know

So you have 4-6 columns in minutes format and want to convert them to hours:minutes format without having to create 3 extra columns for each of them?

Yes that is correct is there a shortcut around this?

First option for you: record them in seconds instead of minutes and use this.

image

Second option: use JavaScript.

const hours = Math.floor(p1 / 60);
const mins = p1 % 60;

return `${hours.toString().padStart(2, '0')}:${mins.toString().padStart(2, '0')}`;

1 Like

Thank you so much this just saved me the hassle I didn’t even know you could use JS

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.