Need some help with variables and loop

psulion01

Board Regular
Joined
Sep 25, 2002
Messages
127
Below is a rough template of the sheet I'm using. I want to define the symbols in the code and associate a commission value to them (i.e. ABC = .05, DEF = .06). In the Gained/Lossed column I want to product of the commission * shares to be populated. some symbols have a minimum value (i.e. $50) while others have no minimum. Also, if $100 or over, data must be populated in Gained, and anything less than $100 must be lost.

I want the code to look in the Symbol column, then match the symbol to the commission value defined in the code, and output the total. If the symbol on the sheet isn't defined in the code I would want an error to be output on the sheet.

I've got a general understanding of IF-Then statements and general BASIC programming, but can't figure out how to define the commission rates and get an error to output.

Any help is greatly appreciated!
Mike
temp sheet.xls
ABCDEFGHIJ
19/27/02
2
3A/CNAMEA/C#B/SSYMSHSPRICEDATEORDER#GainedLost
4SmithSELLABC10000$500.00$0.00
5SmithSELLABC200$0.00$10.00
6DoeBUYDEF5000$300.00$0.00
7DoeBUYDEF100$0.00$50.00
Sheet1
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You will need to build a crossreference table somewhere (possibly on a different sheet) that crossreferences your symbol to a percentage. Then in the calculation use a VLOOKUP to get the related percentage.
 
Upvote 0

Forum statistics

Threads
1,214,798
Messages
6,121,636
Members
449,043
Latest member
farhansadik

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