# Are there solutions of algorithms in Excel?

#### Mamdouh Elfors

##### Member
Hi
Are there solutions of algorithms in Excel?
A solution is required:
3500/2766 = 1.04 ^ n
How to get "n"
Thanks

#### Hui

##### Excel Ninja
Staff member
You can use Goal Seek but a better solution is to derive the solution from a formula by rearrangement

Logs use the function
a = b^c <=> c=Logb(a)

If you have 3500/2766 = 1.04^n

c=log1.04(3500/2766)

so in Excel in a cell type: =Log(3500/2766, 1.04)
=6.00093

Last edited:

#### Peter Bartholomew

##### Well-Known Member
Other implementation of Hui's formula include
= LN(3500/2766) / LN(1.04) [mathematically preferred solution]
and
= LOG(3500/2766, 10) / LOG(1.04, 10) [pre-computer era 'sums']

Out of curiosity, why does the example calculation result in a value so close to the integer 6?
Does the calculation represent 6 years growth, say?

• Mamdouh Elfors

#### Mamdouh Elfors

##### Member
Yes this calculation represents the approximate number of years it takes for cattle growth from 2766 to 3500.

• Peter Bartholomew

#### Peter Bartholomew

##### Well-Known Member
Something else that works is the perfectly opaque function beloved of our finance colleagues
= NPER( 0.04, 0, -2766, 3500 ) 