loop with two variables

kingman29

Board Regular
Joined
Jun 22, 2021
Messages
50
Office Version
  1. 2016
Platform
  1. Windows
Hello
I have a Monster function,
is that possible to make this function inVBA ?
A1 = 15%
B1 = -(15%^1) -(15%^2) -(15%^3) - (15%^4) - (15%^5) - (15%^6) - (15%^7) - (15%^8) - (15%^9)...... -(15%^99)
witch mean every time we subtract A1 with the increase of power
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try this array formula in B1
=SERIESSUM(A1,1,1,-(ROW(A1:A100)^0))
confirmed with Ctrl+Shift+Enter simultaneously, not just Enter

M.
 
Upvote 0
oops 99 is the last power, not 100

Try
=SERIESSUM(A1,1,1,INDEX(-(ROW(A1:A99)^0),))
confirmed with just Enter

M.
 
Upvote 0
Something like this

VBA Code:
With Range("B1")
    .Formula = "=SERIESSUM(A1,1,1,INDEX(-(ROW(A1:A99)^0),))"
    .Value = .Value
End With

M.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top