Hello,
Can anyone help me with this function that I want to loop:
=IF(A1/A8<=1;A1/A8;IF(A1/(SUM(A8:B8))<=1;1+A1/(SUM(A8:B8));IF(A1/(SUM(A8:C8))<=1;2+A1/(SUM(A8:C8));IF(A1/(SUM(A8:D8))<=1;3+A1/(SUM(A8:D8));"a lot"))))
Here;s exapmle:
examplee.xlsx

Instead of "a lot" it should expand this formula up to reaching (24 + 0,xx) value, and it should work in different cells.
So I was thinking about something like creating
=NEWFORMULA(A1;A8)
and then in VBA
Function NEWFORMULA(A As Range, B As Range)
and that's it.. I don't have idea how to go on with it, I think OFFSET could be useful but I don't have any specific idea how to use it. Maybe someone can give me a help and show me direction.

Thanks in advance,
Regards