Looping through Column Finding Name then Proceeding with a function VBA Excel

ericmax79

New Member
Joined
Dec 13, 2013
Messages
37
I have a excel Where i Have 6 different names as variables . The varibles are dynamic . They end up in different rows everytime i do this function . Can someone please help me on how to go about Looping through these names . Finding out which name is which . then performing a different calculation depending on what the "name " is . The names always end up in Column A . They just end up in different rows . So i would like to know how to do a function /macro that looks like this ....... If name = Anna d1=b1*c1 . If name = Harry d1 = b1+c1 ....... Thank you guys . I am new to excel




Code:
[TABLE="width: 604"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Name 
[/TD]
[TD]Number
[/TD]
[TD]Number 
[/TD]
[TD="colspan: 2"] 
[/TD]
[/TR]
[TR]
[TD]Anna
[/TD]
[TD]36.476833
[/TD]
[TD]7.96618557
[/TD]
[TD="colspan: 2"]if name = Anna Number "times Number"
[/TD]
[/TR]
[TR]
[TD]Eric 
[/TD]
[TD]17.451147
[/TD]
[TD]5.80342102
[/TD]
[TD="colspan: 2"]if name = Eric Number = Number 
[/TD]
[/TR]
[TR]
[TD]Ronald
[/TD]
[TD]21.125067
[/TD]
[TD]6.45224857
[/TD]
[TD]If name = Ronald Number "divided"By Number 
[/TD]
[TD]

[/TD]
[/TR]
[TR]
[TD]Roxanne
[/TD]
[TD]12.071469
[/TD]
[TD]2.55927372
[/TD]
[TD="colspan: 2"] 
[/TD]
[/TR]
[TR]
[TD]Harry 
[/TD]
[TD]0
[/TD]
[TD]30.1705704
[/TD]
[TD="colspan: 2"] 
[/TD]
[/TR]
[TR]
[TD]Vallerie
[/TD]
[TD]11.67783
[/TD]
[TD]0
[/TD]
[TD="colspan: 2"] 
[/TD]
[/TR]
[TR]
[TD]Wally 
[/TD]
[TD]0
[/TD]
[TD]6.81271219
[/TD]
[TD="colspan: 2"] 
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
[TABLE="width: 961"]
<colgroup><col><col span="5"><col></colgroup><tbody>[TR]
[TD] Name [/TD]
[TD]Time [/TD]
[TD]Commisson [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Aric 0[/TD]
[TD="align: right"]41.55556[/TD]
[TD="align: right"]21.36111[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]I would Like " if Aric then d1= b1 *c1 [/TD]
[/TR]
[TR]
[TD]Aric 1[/TD]
[TD="align: right"]31.44444[/TD]
[TD="align: right"]5.694445[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Aric 2[/TD]
[TD="align: right"]14.22222[/TD]
[TD="align: right"]5.027778[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Aric 3[/TD]
[TD="align: right"]16.88889[/TD]
[TD="align: right"]4.75[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Aric 4[/TD]
[TD="align: right"]11.66667[/TD]
[TD="align: right"]2.527778[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Eric 0[/TD]
[TD="align: right"]0.222222[/TD]
[TD="align: right"]21.13889[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]If Eric then d1 = B1 + c1 [/TD]
[/TR]
[TR]
[TD]Eric 1[/TD]
[TD="align: right"]9.555555[/TD]
[TD="align: right"]0.138889[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Eric 2[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4.25[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Ronny 3[/TD]
[TD="align: right"]15.66667[/TD]
[TD="align: right"]0.138889[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]If Ronny then d1 = B1 - c1 [/TD]
[/TR]
[TR]
[TD]Ronny 4[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5.472222[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Harry 5[/TD]
[TD="align: right"]14.55556[/TD]
[TD="align: right"]0.25[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]If Harry then d1 = B1 * c1 [/TD]
[/TR]
[TR]
[TD]Harry 6[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]37.11111[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Rick 7[/TD]
[TD="align: right"]18.66667[/TD]
[TD="align: right"]0.138889[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]If Rick then d1 = B1 / c1 [/TD]
[/TR]
[TR]
[TD]Rick 8[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]5.583333[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Vallerie 9[/TD]
[TD="align: right"]2.444444[/TD]
[TD="align: right"]0.027778[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]If Vallerie then d1 = B1 = c1 [/TD]
[/TR]
[TR]
[TD]Valerie 10[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]3.472222[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Wally 11[/TD]
[TD="align: right"]8.555555[/TD]
[TD="align: right"]0.027778[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]If Wally then d1 = B1 + c1 [/TD]
[/TR]
[TR]
[TD]Wally 12[/TD]
[TD="align: right"]0.111111[/TD]
[TD="align: right"]3.583333[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
This is best i have Andrew . I tried to take picture . No Luck . This is the best example i Cna Describe of what i am lacking . Thank You Andrew
 
Upvote 0
Don't you have a table that determines which operator to use? I still don't see any real purpose here. It seems to be an academic exercise.
 
Upvote 0

Forum statistics

Threads
1,225,815
Messages
6,187,188
Members
453,411
Latest member
healthcares

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