Auction calculator app

Mekoides

Old Alpha
Joined
Nov 24, 2006
Posts
951
Location
Chicago, IL, USA
Society
Pyrates of Calypso
Avatar Name
Mekoides Tux Deathbringer
I've developed a new spreadsheet application for calculating auction profits, and I thought I'd share it with the community. It has an easy to use data-entry interface and allows the user to quickly calculate profits of a potential transaction.

The reason I developed my own little app instead of trying to use one already out there, is because I couldn't find one that I liked that would calculate auction fees, allowed me to set my own purchase and sale price, and allowed for the calculation of bulk trades.

This should work with any version of MS Excel 2000 and newer.

http://www.mediafire.com/?d7fjx5vhwbyvr13

If anyone has any suggestions for improvement, please let me know.

The spreadsheet opens in a pretty simple view
[br]Click to enlarge[/br]

Clicking the "New Entry" button brings up the data entry page - all fields have tool tips describing what belongs where. The "MU Type" dropdown menu allows the user to differentiate between the two markup types - percentage and TT+
dataentry.jpg


Clicking the "Add Row" button will take all of the entered (and calculated) data and add it to a new row in the spreadsheet, allowing the tracking of multiple items within a single trade.
[br]Click to enlarge[/br]

For those interested, this is the entire source code - very simple data entry/calculation functions. I'd be happy to explain any of it if anyone has questions.

Code:
Private Sub CommandButton1_Click()
UpdateValues
Range("A1").End(xlDown).Offset(1, 0).Select
If (ItemDescription.Value = "") Then
ItemDescription.Value = "No Description"
End If

ActiveCell.Value = ItemDescription.Value
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = TTValue.Value
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = AucPrice.Value
ActiveCell.Offset(0, 1).Activate
If (ItemType.Value = "%") Then
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = PctMUPaid.Value * 0.01
Else
ActiveCell.Value = TTMUPaid.Value
ActiveCell.Offset(0, 1).Activate
End If
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = "=(ROUNDDOWN(C" & ActiveCell.Row & ",0))-B" & ActiveCell.Row
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = "=(ROUNDDOWN(C" & ActiveCell.Row & ",0))/B" & ActiveCell.Row
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = "=IF(ROUNDDOWN(0.5+F" & ActiveCell.Row & "*99.5/(1990+F" & ActiveCell.Row & "),2)<0.5,0.5,ROUNDDOWN(0.5+F" & ActiveCell.Row & "*99.5/(1990+F" & ActiveCell.Row & "),2))"
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = "=IF(D" & ActiveCell.Row & "<>0,IF(E" & ActiveCell.Row & "=0,C" & ActiveCell.Row & "-(D" & ActiveCell.Row & "+B" & ActiveCell.Row & ")-H" & ActiveCell.Row & ",),IF(E" & ActiveCell.Row & "<>0,C" & ActiveCell.Row & "-E" & ActiveCell.Row & "*B" & ActiveCell.Row & "-H" & ActiveCell.Row & ",F" & ActiveCell.Row & "-H" & ActiveCell.Row & "))"


End Sub

Private Sub ItemType_Change()

If (ItemType.Value = "%") Then
MULabel.Visible = True
PctMUPaid.Visible = True
TTMUPaid.Visible = False
TTMUPaid.Value = 0
Label8.Visible = False
Label7.Visible = False
Label9.Visible = True
MUPCT.Visible = True
Label13.Visible = True
Label14.Visible = True
End If

If (ItemType.Value = "TT+") Then
MULabel.Visible = True
TTMUPaid.Visible = True
PctMUPaid.Visible = False
PctMUPaid.Value = 100
Label8.Visible = True
Label7.Visible = True
Label9.Visible = False
MUPCT.Visible = False
Label13.Visible = False
Label14.Visible = False
End If

UpdateValues
End Sub

Private Sub PctMUPaid_Change()
If (PctMUPaid.Value < 0) Then
PctMUPaid.Value = 100
End If
If (PctMUPaid.Value > 9999999) Then
PctMUPaid.Value = 0
End If
UpdateValues
End Sub

Private Sub SpinButton6_Change()
UpdateValues
End Sub

Private Sub SpinButton2_Change()
UpdateValues
End Sub

Private Sub SpinButton3_Change()
UpdateValues
End Sub

Private Sub SpinButton4_Change()
UpdateValues
End Sub

Private Sub SpinButton5_Change()
UpdateValues
End Sub

Private Sub TTMUPaid_Change()
UpdateValues
End Sub

Private Sub TTValue_Change()
If (TTValue.Value = ".") Then
TTValue.Value = "0."
End If
UpdateValues
End Sub

Private Sub UserForm_Initialize()
ItemType.AddItem "TT+"
ItemType.AddItem "%"
End Sub

Private Function UpdateValues()

Dim truncate As Double

If TTValue.Value < 0 Then
TTValue.Value = 0
End If
If TTValue.Value > 99999 Then
TTValue.Value = 0
End If

AucPrice.Value = (SpinButton6.Value - 50) + (SpinButton5.Value - 50) * 10 + (SpinButton4.Value - 50) * 100 + (SpinButton3.Value - 50) * 1000 + (SpinButton2.Value - 50) * 10000
MUPed.Value = AucPrice.Value - TTValue.Value
If (TTValue.Value > 0) Then
truncate = (AucPrice.Value / TTValue.Value * 100) * 100
truncate = Int(truncate)
MUPCT.Value = truncate / 100
End If

If ((0.5 + MUPed.Value * 99.5 / (1990 + MUPed.Value)) < 0.5) Then
AucFee.Value = 0.5
Else
If ((0.5 + MUPed.Value * 99.5 / (1990 + MUPed.Value)) > 99.5) Then
If (TTValue.Value > AucPrice.Value) Then
AucFee.Value = 0.5
Else
AucFee.Value = 99.5
End If
Else
truncate = (0.5 + MUPed.Value * 99.5 / (1990 + MUPed.Value)) * 100
truncate = Int(truncate)
AucFee.Value = truncate / 100
End If
End If

If (ItemType.Value = "%") Then
If (TTValue.Value > 0) Then
truncate = (AucPrice.Value - ((PctMUPaid.Value * 0.01 - 1) * TTValue.Value) - TTValue.Value - AucFee.Value) * 100
truncate = Int(truncate)
Profit.Value = truncate / 100
End If
End If

If (ItemType.Value = "TT+") Then
If (TTValue.Value > 0) Then
Profit.Value = AucPrice.Value - TTMUPaid.Value - TTValue.Value - AucFee.Value
End If
End If

End Function
 
Last edited:
I could not find any viruses with AVG, so the file looks to be clean. Not that I don't trust you, but it pays to be careful - especially these days.

Checked by AVG - www.avg.com
Version: 9.0.830 / Virus Database: 271.1.1/3002 - Release Date: 07/13/10 14:36:00

:wtg:
 
I could not find any viruses with AVG, so the file looks to be clean. Not that I don't trust you, but it pays to be careful - especially these days.

Checked by AVG - www.avg.com
Version: 9.0.830 / Virus Database: 271.1.1/3002 - Release Date: 07/13/10 14:36:00

:wtg:

And i wouldnt trust avg :p
 
I could not find any viruses with AVG, so the file looks to be clean. Not that I don't trust you, but it pays to be careful - especially these days.

I totally understand - I'd be weary of any macro-containing Excel spreadsheet not coming straight from Microsoft too. (And double-weary of any coming from Microsoft) ;)
 
Well the code looks ok , anyone who want to use it should compile it themselves to be sure.

Im sure your intentions are the best , but to clarify to the ppl who trust in antivirus software, antivirus software rely on a signature database of KNOWN viruses and trojans. This means if i make a uniqe modified version of my favorite trojan or rootkit you will install it knowing nothing , ofcourse i bind it together with some fancy software you really need to have :) ...

anyway , this code looks clean , fire away and keep track of your profits ppl.

cheers and surf safe out there

ermik
 
very nice app but some of the calculations are off from a few pec to a few ped i think its because you are rounding the mu% to the closest decimal point over the space of a couple trades u could actully be slighty in the loss instead of profit.
 
very nice app but some of the calculations are off from a few pec to a few ped i think its because you are rounding the mu% to the closest decimal point over the space of a couple trades u could actully be slighty in the loss instead of profit.

The rounding is always down, and always to the pec (not ped).

There are two things this app rounds down - first is the auction fee. According to the documentation I read on this forum as well as my own tests, auction fees are always rounded down. IE: if the formula calculates an auciton fee to be 1.68992 peds, the fee will be 1.68 and not 1.69. Assuming this is correct, rounding down is the only way to accurately calculate the "real" auction fee.

The second rounded figure is the calculated markup (both as a TT+ and the %). You input the TT value and the auciton sale price, and markup is calculated. Since the game doesn't display values of less than 1 pec, I kept my program in line with that.

Since the calculated markup is always rounded DOWN (IE 1.8194 ped is rounded to 1.81 ped), the app may display a profit of a few pecs less than is actual, but will never display more profit than you got.

I'll change the rounding to be for display purposes only, and have the calculations use non-rounded figures when I have an hour or two to mess around with it. Thanks for the input!
 
The rounding is always down, and always to the pec (not ped).

There are two things this app rounds down - first is the auction fee. According to the documentation I read on this forum as well as my own tests, auction fees are always rounded down. IE: if the formula calculates an auciton fee to be 1.68992 peds, the fee will be 1.68 and not 1.69. Assuming this is correct, rounding down is the only way to accurately calculate the "real" auction fee.

The second rounded figure is the calculated markup (both as a TT+ and the %). You input the TT value and the auciton sale price, and markup is calculated. Since the game doesn't display values of less than 1 pec, I kept my program in line with that.

Since the calculated markup is always rounded DOWN (IE 1.8194 ped is rounded to 1.81 ped), the app may display a profit of a few pecs less than is actual, but will never display more profit than you got.

I'll change the rounding to be for display purposes only, and have the calculations use non-rounded figures when I have an hour or two to mess around with it. Thanks for the input!

heres a example i got

tt value 9.81 mu type % markup paid 4474.08% auction sale price 490

results

markup 480.19 auction fee 19.84 markup 4994.9% profit 31.25

the real profit should be 31.16 profit and not 31.25 the auction fee is spot on and dont think the problem is there so u can see it is calculateing more profit then you got which could suck if your useing it on bulk trades i aprecate the effort you put in man its a sick app and will keep on useing it most of the calculations ive done useing it tho are spot on so its kinda weird.
 
How are you calculating the profit to be 31.16? I'm doing the calculations manually and come up with the same results as the app. Please let me know if my math is faulty here - I want this app to be 100% accurate.

9.81(TT Value) X 44.7408(Markup Paid) = 438.907248(Total price paid for item)

438.907248(Paid price) + 19.84(Auciton Fee) = 458.747248 (Total cost)

490(Auction Sell Price) - 458.747248(Total Cost) = 31.252752 (Profit)

the program drops the fractions of a pec and gives you a profit of 31.25
 
How are you calculating the profit to be 31.16? I'm doing the calculations manually and come up with the same results as the app. Please let me know if my math is faulty here - I want this app to be 100% accurate.

9.81(TT Value) X 44.7408(Markup Paid) = 438.907248(Total price paid for item)

438.907248(Paid price) + 19.84(Auciton Fee) = 458.747248 (Total cost)

490(Auction Sell Price) - 458.747248(Total Cost) = 31.252752 (Profit)

the program drops the fractions of a pec and gives you a profit of 31.25

ahh k this trade was done assumeing you used auction to buy also and auction would of rounded it up to 439 as price paid i get it now.
 
ahh k this trade was done assumeing you used auction to buy also and auction would of rounded it up to 439 as price paid i get it now.

OK, totally makes sense. In this case, you're sort of treating the stack as one "item". Since you paid an exact ped amount, rather than an exact % amount, select "TT+" as the markup type and enter the following:

TT Value: 9.81
Markup Paid: 429.19
Auciton Sale Price: 490


Results:
Markup: 480.19
Auction Fee: 19.84
Profit: 31.16
 
Run-time Error '13':
Type mismatch

Gives when clicking new entry, changed tt value and after that changing MU Type. Debugger directs me to line:

Profit.Value = AucPrice.Value - TTMUPaid.Value - TTValue.Value - AucFee.Value

Microsoft Excel 2010
 
Run-time Error '13':
Type mismatch

Gives when clicking new entry, changed tt value and after that changing MU Type. Debugger directs me to line:

Profit.Value = AucPrice.Value - TTMUPaid.Value - TTValue.Value - AucFee.Value

Microsoft Excel 2010

I am not able to recreate this error using Microsoft Excel 2010 (build 14.0.4760.1000). Can you please list the exact steps you perform to get this error?

When I open the spreadsheet, click new entry, enter a TT value, then change markup type, it works properly - no errors at all.
 
This sounds like an awesome program but the URL doesn't work anymore...anyone know where I can get this from? Any help would be awesome! Thanks!

TrainedPanic


I've developed a new spreadsheet application for calculating auction profits, and I thought I'd share it with the community. It has an easy to use data-entry interface and allows the user to quickly calculate profits of a potential transaction.

The reason I developed my own little app instead of trying to use one already out there, is because I couldn't find one that I liked that would calculate auction fees, allowed me to set my own purchase and sale price, and allowed for the calculation of bulk trades.

This should work with any version of MS Excel 2000 and newer.

http://www.mediafire.com/?dn0momiiv0g

If anyone has any suggestions for improvement, please let me know.

The spreadsheet opens in a pretty simple view
[br]Click to enlarge[/br]

Clicking the "New Entry" button brings up the data entry page - all fields have tool tips describing what belongs where. The "MU Type" dropdown menu allows the user to differentiate between the two markup types - percentage and TT+
dataentry.jpg


Clicking the "Add Row" button will take all of the entered (and calculated) data and add it to a new row in the spreadsheet, allowing the tracking of multiple items within a single trade.
[br]Click to enlarge[/br]

For those interested, this is the entire source code - very simple data entry/calculation functions. I'd be happy to explain any of it if anyone has questions.

Code:
Private Sub CommandButton1_Click()
UpdateValues
Range("A1").End(xlDown).Offset(1, 0).Select
If (ItemDescription.Value = "") Then
ItemDescription.Value = "No Description"
End If

ActiveCell.Value = ItemDescription.Value
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = TTValue.Value
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = AucPrice.Value
ActiveCell.Offset(0, 1).Activate
If (ItemType.Value = "%") Then
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = PctMUPaid.Value * 0.01
Else
ActiveCell.Value = TTMUPaid.Value
ActiveCell.Offset(0, 1).Activate
End If
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = "=(ROUNDDOWN(C" & ActiveCell.Row & ",0))-B" & ActiveCell.Row
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = "=(ROUNDDOWN(C" & ActiveCell.Row & ",0))/B" & ActiveCell.Row
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = "=IF(ROUNDDOWN(0.5+F" & ActiveCell.Row & "*99.5/(1990+F" & ActiveCell.Row & "),2)<0.5,0.5,ROUNDDOWN(0.5+F" & ActiveCell.Row & "*99.5/(1990+F" & ActiveCell.Row & "),2))"
ActiveCell.Offset(0, 1).Activate
ActiveCell.Value = "=IF(D" & ActiveCell.Row & "<>0,IF(E" & ActiveCell.Row & "=0,C" & ActiveCell.Row & "-(D" & ActiveCell.Row & "+B" & ActiveCell.Row & ")-H" & ActiveCell.Row & ",),IF(E" & ActiveCell.Row & "<>0,C" & ActiveCell.Row & "-E" & ActiveCell.Row & "*B" & ActiveCell.Row & "-H" & ActiveCell.Row & ",F" & ActiveCell.Row & "-H" & ActiveCell.Row & "))"


End Sub

Private Sub ItemType_Change()

If (ItemType.Value = "%") Then
MULabel.Visible = True
PctMUPaid.Visible = True
TTMUPaid.Visible = False
TTMUPaid.Value = 0
Label8.Visible = False
Label7.Visible = False
Label9.Visible = True
MUPCT.Visible = True
Label13.Visible = True
Label14.Visible = True
End If

If (ItemType.Value = "TT+") Then
MULabel.Visible = True
TTMUPaid.Visible = True
PctMUPaid.Visible = False
PctMUPaid.Value = 100
Label8.Visible = True
Label7.Visible = True
Label9.Visible = False
MUPCT.Visible = False
Label13.Visible = False
Label14.Visible = False
End If

UpdateValues
End Sub

Private Sub PctMUPaid_Change()
If (PctMUPaid.Value < 0) Then
PctMUPaid.Value = 100
End If
If (PctMUPaid.Value > 9999999) Then
PctMUPaid.Value = 0
End If
UpdateValues
End Sub

Private Sub SpinButton6_Change()
UpdateValues
End Sub

Private Sub SpinButton2_Change()
UpdateValues
End Sub

Private Sub SpinButton3_Change()
UpdateValues
End Sub

Private Sub SpinButton4_Change()
UpdateValues
End Sub

Private Sub SpinButton5_Change()
UpdateValues
End Sub

Private Sub TTMUPaid_Change()
UpdateValues
End Sub

Private Sub TTValue_Change()
If (TTValue.Value = ".") Then
TTValue.Value = "0."
End If
UpdateValues
End Sub

Private Sub UserForm_Initialize()
ItemType.AddItem "TT+"
ItemType.AddItem "%"
End Sub

Private Function UpdateValues()

Dim truncate As Double

If TTValue.Value < 0 Then
TTValue.Value = 0
End If
If TTValue.Value > 99999 Then
TTValue.Value = 0
End If

AucPrice.Value = (SpinButton6.Value - 50) + (SpinButton5.Value - 50) * 10 + (SpinButton4.Value - 50) * 100 + (SpinButton3.Value - 50) * 1000 + (SpinButton2.Value - 50) * 10000
MUPed.Value = AucPrice.Value - TTValue.Value
If (TTValue.Value > 0) Then
truncate = (AucPrice.Value / TTValue.Value * 100) * 100
truncate = Int(truncate)
MUPCT.Value = truncate / 100
End If

If ((0.5 + MUPed.Value * 99.5 / (1990 + MUPed.Value)) < 0.5) Then
AucFee.Value = 0.5
Else
If ((0.5 + MUPed.Value * 99.5 / (1990 + MUPed.Value)) > 99.5) Then
If (TTValue.Value > AucPrice.Value) Then
AucFee.Value = 0.5
Else
AucFee.Value = 99.5
End If
Else
truncate = (0.5 + MUPed.Value * 99.5 / (1990 + MUPed.Value)) * 100
truncate = Int(truncate)
AucFee.Value = truncate / 100
End If
End If

If (ItemType.Value = "%") Then
If (TTValue.Value > 0) Then
truncate = (AucPrice.Value - ((PctMUPaid.Value * 0.01 - 1) * TTValue.Value) - TTValue.Value - AucFee.Value) * 100
truncate = Int(truncate)
Profit.Value = truncate / 100
End If
End If

If (ItemType.Value = "TT+") Then
If (TTValue.Value > 0) Then
Profit.Value = AucPrice.Value - TTMUPaid.Value - TTValue.Value - AucFee.Value
End If
End If

End Function
 
The URL doesn't work for this...anyone know where I can get this program from?

I'll upload another copy either today or tomorrow and post the link here.
 
OP has been updated with a new link.
 
Back
Top