Target Land Calculator

WTFudge

Planter
Joined
Oct 5, 2011
Messages
32
Working on a land calculator that calculates how much funds it costs to get to x land from x land: E.g if your on 10k land and want to calculate how much it costs to from 11k to 12k you can use this tool!

I got the multiplier values down, I just need more information!

I need people to do this:

1 acre will cost you 81,838,000
2 acres will cost you 163,708,000
3 acres will cost you 245,610,000
4 acres will cost you 327,544,000
5 acres will cost you 409,510,000
6 acres will cost you 491,508,000
7 acres will cost you 573,538,000
8 acres will cost you 655,600,000
9 acres will cost you 737,694,000
10 acres will cost you 819,820,000

2,556 Land

1 acre will cost you 309,646,000
2 acres will cost you 619,356,000
3 acres will cost you 929,130,000
4 acres will cost you 1,238,968,000
5 acres will cost you 1,548,870,000
6 acres will cost you 1,858,836,000
7 acres will cost you 2,168,866,000
8 acres will cost you 2,483,056,000
9 acres will cost you 2,793,726,000
10 acres will cost you 3,104,460,000

4,845 Land

1 acre will cost you 1,018,934,000
2 acres will cost you 2,037,988,000
3 acres will cost you 3,057,162,000
4 acres will cost you 4,076,456,000
5 acres will cost you 5,095,870,000
6 acres will cost you 6,115,404,000
7 acres will cost you 7,135,058,000
8 acres will cost you 8,154,832,000
9 acres will cost you 9,174,726,000
10 acres will cost you 10,194,740,000
100 acres will cost you 102,487,400,000
500 acres will cost you 538,028,560,000
1000 acres will cost you 1,140,053,320,000

8,490 Land

1 acre will cost you 4,608,270,000
2 acres will cost you 9,216,796,000
3 acres will cost you 13,825,578,000
4 acres will cost you 18,434,616,000
5 acres will cost you 23,043,910,000
6 acres will cost you 27,653,460,000
7 acres will cost you 32,263,266,000
8 acres will cost you 36,873,328,000
9 acres will cost you 41,483,646,000
10 acres will cost you 46,094,220,000

18,000 acres total

1 acre will cost you 5,159,582,000
2 acres will cost you 10,319,436,000
3 acres will cost you 15,479,562,000
4 acres will cost you 20,639,960,000
5 acres will cost you 25,800,630,000
6 acres will cost you 30,961,572,000
7 acres will cost you 36,122,786,000
8 acres will cost you 41,284,272,000
9 acres will cost you 46,446,030,000
10 acres will cost you 51,608,060,000

18,968 acres total

That format would be great.
 

CFalcon

Official Helper
Joined
Dec 14, 2007
Messages
680
Location
Kent UK
I know that between 5 and 1000 acres land cost follows the formula below. Once you go past 1000 acres it switches from a linear to an exponential formula.

59000*(A+B-5)+(9000*(A+B-4)*(A+B-5)/2)-(59000*(B-5)+9000*(B-4)*(B-5)/2)

A = Acres to be bought
B = Current acres
 

WTFudge

Planter
Joined
Oct 5, 2011
Messages
32
I know that between 5 and 1000 acres land cost follows the formula below. Once you go past 1000 acres it switches from a linear to an exponential formula.

59000*(A+B-5)+(9000*(A+B-4)*(A+B-5)/2)-(59000*(B-5)+9000*(B-4)*(B-5)/2)

A = Acres to be bought
B = Current acres

I was wondering why my lower value calc was working perfectly then when it came to my upper end calc (10,000 land) it was quite a way off. Figured there was a change in the price per acre or as I like to call it 'land value multiplier'.

The way I worked it out was different though, yours seems like a more exact formulae and thanks for that it will prove very useful.
 

Polo

Garden Designer
Super Moderator
Joined
Dec 14, 2007
Messages
1,005
I think this may help:

Code:
 function LandCost( iBuyLand, iCurrentLand )
 {
  var iTotalCost = 0;
  var iLCount = 0;
  var iThisCost = 0;
  var iMultiplier = 0;
  while (iLCount < iBuyLand) {
   iLCount = iLCount + 1;
   iThisCost = 14000;
   if ((iCurrentLand + iLCount) > 999) {
    iMultiplier = (Math.floor((iCurrentLand + iLCount) / 550));
    if (iMultiplier < 1) { iMultiplier = 1; }
    iThisCost = iThisCost + ((8000 * iMultiplier) * (iCurrentLand + iLCount));
   } else {
    iThisCost = iThisCost + (9000 * (iCurrentLand + iLCount));
   }
   iTotalCost = iTotalCost + iThisCost;
  }
  return iTotalCost;
 }

Stolen from the javascript on the land management page.
 

willymchilybily

Landscape Designer
Joined
Dec 14, 2007
Messages
1,418
Location
uk
I know that between 5 and 1000 acres land cost follows the formula below. Once you go past 1000 acres it switches from a linear to an exponential formula.

59000*(A+B-5)+(9000*(A+B-4)*(A+B-5)/2)-(59000*(B-5)+9000*(B-4)*(B-5)/2)

A = Acres to be bought
B = Current acres

I thought for a second it was the same as mine.

=(((41000+(B*4500))+(4500*C))*((B-5)+C))-(((41000+(5*4500))+(4500*(B-5)))*((B-5)))

probably is if i factor in all the terms nicely. and consolidate it a bit more.

b= acres already have
c= acres to be bought

I thought it worked for land past 1000 though (it falls down at the next limitwherver that is set i know that much). maybe I was just still testing buying more when i had under 1000 acres. If some one could giver me an example of cost for buying 1 acres between when you larn is >1000 and <10,000 id be interested to see if it did work beyond 1000 acres.

though polo is pro.
 

willymchilybily

Landscape Designer
Joined
Dec 14, 2007
Messages
1,418
Location
uk
I think this may help:

Code:
 function LandCost( iBuyLand, iCurrentLand )
 {
  var iTotalCost = 0;
  var iLCount = 0;
  var iThisCost = 0;
  var iMultiplier = 0;
  while (iLCount < iBuyLand) {
   iLCount = iLCount + 1;
   iThisCost = 14000;
   if ((iCurrentLand + iLCount) > 999) {
    iMultiplier = (Math.floor((iCurrentLand + iLCount) / 550));
    if (iMultiplier < 1) { iMultiplier = 1; }
    iThisCost = iThisCost + ((8000 * iMultiplier) * (iCurrentLand + iLCount));
   } else {
    iThisCost = iThisCost + (9000 * (iCurrentLand + iLCount));
   }
   iTotalCost = iTotalCost + iThisCost;
  }
  return iTotalCost;
 }

Stolen from the javascript on the land management page.

think im being stupid. i still dont get it after you go past 999 acres.
i get a number close to but not the same as

so
land multiplier = (current land * land to be bought)/550 [only applies when over 999 acres]
cost = 14,000 + (8000*multiplier) * (current land +land to be bought)

but in reality the number you get is far closer if you round down the multiplier to no decimal point.
and use the formulae

[14000+((8000*m)*(a + 1))]*B - ((B*(B-1))*164000)

m = multiplier above
a = current land
b = land to be bought


so in excel

enter the cells as the following

b1 = land cost = "=IF(B3>999,((B5+((8000*B6)*(B3+1)))*B2)+((B2*(B2-1))*164000),B5+(9000*(B3+B2)))"
b2 = buy land amount = user input
b3= current land = user input

b5 = factor = "14,000"
b6 = multiplier = "=ROUNDDOWN(IF((B3+B2)/550<1,1,(B3+B2)/550),0)"

it works for me i think.
 
Last edited:

CFalcon

Official Helper
Joined
Dec 14, 2007
Messages
680
Location
Kent UK
Considering battle reports round down to whole integers, it would make sense that land calculations do as well.
 

LuckySports

Landscape Designer
Joined
Jul 7, 2008
Messages
1,243
Location
Nonya
this is what I've worked out..

Land Cost = TC*LtB

TC =IF((CL+LtB)>999; 14000 + ((8000* M)*(CL+LtB)); 14000+(9000*(LtB+CL)))

M =ROUNDDOWN(IF(LtB=0;0;(if((LtB+CL)/500<1;1;(LtB+CL)/550))))

M = multiplyer
LtB = LandToBuy
CL = Current Land
TC = This Cost

I'm close, but its not quite there.. I'm perfect on 1 acre, but 2 acres is 9k off, and 3 is 28k off.. I'm missing something somewhere..

EDIT: okay, I know what the issue is, no idea how to fix it.. at least not in an excel formula..

my "this cost" is only calculating the cost of the LAST ACRE BOUGHT in the number of acres, so if you are buying 3 acres on 5 land, it will assume you have 7 acres and are buying 1. Let me know if anyone can figure out a solution for this..

btw - I'm making steve_gods round-start calculator more user-friendly.. :p not a LOT more user friendly, its been a LONG ASS TIME since I did much with excel..



EDIT2:

This is how his calculation works..

okay

basicly

1. landcount = 0 <--- this is the first pass
2. landcount = landcount + 1 <---- increase landcount each pass
3. IF(Current acres + landcount > 999; then thiscost = (14,000 + ((8,000*Multiplyer)*(Landcount + totalland)); else thiscost = (14,000 + (9,000 *(landcount + totalland))) <-- if your acres + your current land count is at 1,000 or more, use the calc for this acre, otherwise, use ther other
4. Totalcost = Totalcost + Thiscost <--- Adding this pass's cost to the total cost
5. if (landcount = landtobuy; then goto 6, else goto 2) <--- Determining if it needs to do another pass for another acre
6. display totalcost <---- displays your results.

there you go!
 
Last edited:

willymchilybily

Landscape Designer
Joined
Dec 14, 2007
Messages
1,418
Location
uk
this is what I've worked out..

Land Cost = TC*LtB

TC =IF((CL+LtB)>999; 14000 + ((8000* M)*(CL+LtB)); 14000+(9000*(LtB+CL)))

M =ROUNDDOWN(IF(LtB=0;0;(if((LtB+CL)/500<1;1;(LtB+CL)/550))))

M = multiplyer
LtB = LandToBuy
CL = Current Land
TC = This Cost

I'm close, but its not quite there.. I'm perfect on 1 acre, but 2 acres is 9k off, and 3 is 28k off.. I'm missing something somewhere..

EDIT: okay, I know what the issue is, no idea how to fix it.. at least not in an excel formula..

my "this cost" is only calculating the cost of the LAST ACRE BOUGHT in the number of acres, so if you are buying 3 acres on 5 land, it will assume you have 7 acres and are buying 1. Let me know if anyone can figure out a solution for this..

i see where my formulae failed now, cheers, the solution to this is:

f(n)=((n^2)+n)/2

as this formula is the equivalent of
1=1
2=2+1
3=3+2+1

ergo 9=9+8+7+6+5+4+3+2+1...this is the key to your issue.

so now in stead of 14000+(9000*(LtB+CL), with several passes you can use the equation

14,000+(9000*(CL+1)*Ltb)+(9000*((Ltb^2)-Ltb)/2)) note the minus sign not plus and the plus 1 is just so you can get the cost of one acre multiplied by the number of acres. then the extra cost of an additional acre (which has the multiplier effect)

anyway long and short is this:
bushcalcland.png


and the long excell formula is : (stupid 'IF' statements, three possible options buying land with owned land already >999, buying land and remaining under 999 or buying land and a few acres go over 999 acres and charged at a different value to the others. thats why it looks so nasty)

=IF(B3>999,((B5+((8000*B6)*(B3+1)))*B7)+((B7*(B7-1)/2)*8000),IF((B3+B2>999),((B5+((8000*B6)*(999+1)))*B7)+((B7*(B7-1)/2)*8000)+((B5+(9000*(B3+1)))*B8 )+((((B8^2)-B8 )/2)*9000),((B5+(9000*(B3+1)))*B2)+((((B2^2)-B2)/2)*9000)))

but it fails with the multiplier somehow, as i try to buy too many acres above 1094 then it gets thrown off by the multiplier kicking in.. i dunno why. illl have to test more when not tired. and post the final version unless some one finds it first.
 
Last edited:

LuckySports

Landscape Designer
Joined
Jul 7, 2008
Messages
1,243
Location
Nonya
this is what I've worked out..

Land Cost = TC*LtB

TC =IF((CL+LtB)>999; 14000 + ((8000* M)*(CL+LtB)); 14000+(9000*(LtB+CL)))

M =ROUNDDOWN(IF(LtB=0;0;(if((LtB+CL)/500<1;1;(LtB+CL)/550))))

M = multiplyer
LtB = LandToBuy
CL = Current Land
TC = This Cost

I'm close, but its not quite there.. I'm perfect on 1 acre, but 2 acres is 9k off, and 3 is 28k off.. I'm missing something somewhere..

EDIT: okay, I know what the issue is, no idea how to fix it.. at least not in an excel formula..

my "this cost" is only calculating the cost of the LAST ACRE BOUGHT in the number of acres, so if you are buying 3 acres on 5 land, it will assume you have 7 acres and are buying 1. Let me know if anyone can figure out a solution for this..

i see where my formulae failed now, cheers, the solution to this is:

=((n^2)+n)/2

as this formula is the equivalent of
1=1
2=2+1
3=3+2+1

ergo 9=9+8+7+6+5+4+3+2+1...this is the key to your issue.

so now in stead of 14000+(9000*(LtB+CL), with several passes you can use the equation

14,000+(9000*(CL+1)*Ltb)+(9000*((Ltb^2)-Ltb)/2)) note the minus sign not plus and the plus 1 is just so you can get the cost of one acre multiplied by the number of acres. then the extra cost of an additional acre (which has the multipler effect.

anyway long and short is this:
bushcalcland.png


and the long excell formula is :(stupid 'IF' statements, three possible options buying land with owned land already >999, buying land and remaining under 999 or buying land and a few acres go over 999 acres and charge at a different value to the others. thats why it looks so nasty)

=IF(B3>999,((B5+((8000*B6)*(B3+1)))*B7)+((B7*(B7-1)/2)*8000),IF((B3+B2>999),((B5+((8000*B6)*(999+1)))*B7)+((B7*(B7-1)/2)*8000)+((B5+(9000*(B3+1)))*B8)+((((B8^2)-B8)/2)*9000),((B5+(9000*(B3+1)))*B2)+((((B2^2)-B2)/2)*9000)))

but it fails at som point, as if i try to buy too many acres above just a few above 1000 then it gets thrown off. i dunno why. illl have to test more when not tired. and post the final version unless some one finds it first.

Yeah, I created a macro to do my calculations for me.. ^_^ I have the formula right, but when you go over 999, something changes.. It gets rounded somewhere and starts throwing off my calculations... :( It's close at the moment though, so I'm happy with it.. Had to learn how to write in visual basic again yesterday to make the macro :p
 

willymchilybily

Landscape Designer
Joined
Dec 14, 2007
Messages
1,418
Location
uk
Yeah, I created a macro to do my calculations for me.. ^_^ I have the formula right, but when you go over 999, something changes.. It gets rounded somewhere and starts throwing off my calculations... :( It's close at the moment though, so I'm happy with it.. Had to learn how to write in visual basic again yesterday to make the macro :p


im so close. i know the problem with the multiplier I was having..... when you go from multiplier of 1 to multiplier of two it treats all the land you bought above 999 at that multiplier. not all the land actually bought at the multiplier of 2.. should be able to fix it with an IF statement in the excel formula.
 

timtadams

Landscape Designer
Joined
Sep 9, 2008
Messages
2,260
Location
Australia
Why dont you just fit the two ranges empirically?
Then calc cost of current land, cost of total land after purchase, then take the difference...

I thought this was really simple...
 

CFalcon

Official Helper
Joined
Dec 14, 2007
Messages
680
Location
Kent UK
Why dont you just fit the two ranges empirically?
Then calc cost of current land, cost of total land after purchase, then take the difference...

I thought this was really simple...

That cuts out 1 step, but still leaves all the hard work ahead of you.

At least, it's hard work in a spreadsheet. As Polo demonstrated, it's piss easy in a proper language.
 

LuckySports

Landscape Designer
Joined
Jul 7, 2008
Messages
1,243
Location
Nonya
Yea, as CF said, its a lot harder to do the calc in an excel spreadsheet :p Its easy enough up to 999 acres, after that, there's a rounding issue that throws the calc off..
 

timtadams

Landscape Designer
Joined
Sep 9, 2008
Messages
2,260
Location
Australia
ahh, i remember now.

I had tried to do this before, but couldnt get it work in Excel. Then i got the function just like Polo, but for some reason i couldnt understand it.

And now that I look at it again, i can't work out what about it didnt understand. Maybe i had some kind of mental block or was tired at the time.
 

timtadams

Landscape Designer
Joined
Sep 9, 2008
Messages
2,260
Location
Australia
This will calculate, exactly, the cost of buying land from 6 to 999 land:

Code:
n*(14000 + 9000*(C+(n+1)/2))

Where
n = land to buy
C = current land

Derived from actual function

[edit]
The use of rounding in the instance of buying to over 999 means a formula is not simple. Given rounding occurs every loop, this cannot be expressed in a single formula. You would have to calculate at which pass the multiplier changes, and break up the land costs according to each multiplier (i think).

(of course it's easy in programming language (you could pretty much copy paste function from page source), but i think many people would prefer Excel option)
 
Last edited:
Top