Forum Discussion

Lost1nExcel's avatar
Lost1nExcel
Copper Contributor
Mar 29, 2023

Excel Custom Function

I am trying to write a custom function for rounding a set of data. So that I can reuse it for each form I create and not have to rewrite the whole function.

I have tried to use Macros and VBA but frankly I have no idea what to write in them, I tried an assortment of things but none worked.

The code i wish to simplify into its own function:

=IF(ISODD(ActiveCell.value),CEILING(ActiveCell.value,1),FLOOR(ActiveCell.value,1))


so for example F3 contains the value of 31.2

 

=IF(ISODD(F3),CEILING(F3,1),FLOOR(F3,1))

= 32

 

Can I make this it’s own function?

4 Replies

Resources