That’s a bit harder, unfortunately there is no support for locally defined parameterized formulas. There’s an old thread here
To make your use-case dry you’d need a custom pack with a parameterized formula