Excel VBA checklist resulting

proskopos

New Member
Joined
Dec 8, 2013
Messages
3
JzDUo.jpg


I have the spreadsheet above, that describes a job's Income, outcome, and profit. It also shows if an employee took place in that job or not, in order to calculate his income. In the demo above, for the 1st job employees A,B,C will share 70$, and for the 2nd job A and C will share 140$. That means (for the second table) that A = 70/3 +14/2 = 93.3, b = 70/3 + 0 = 23.3 etc.
So if someone has taken part in a job, i have to choose the appropriate box, to calculate his income.
The question is what should i do, in order to auto calculate the employees income, when his checkbox is null or not for every job.

(Checkboxes are activeX control checkboxes and in each row there are grouped)


 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
proskopos,

Welcome to MrExcel.

Here is a possible solution that will avoid having to use vba.

It may well depend on the extent of your data as I can imagine that you might be dealing with a lot of check boxes?/

So...

In the checkbox properties, set the linked cell to the cell in wich it sits.
The cell wil then take on value TRUE if checkbox is checked.
The cells can have text set to White so as to make it 'invisible'.

Then perhaps a 'helper' cell eg J (which could be hidden) that holds the profit per employee for the job.

Then formula in K5 and copy accross.


Excel 2007
ABCDEFGHIJKLMN
3Helper
4RefJobInOutProfitABCDPer EmpABCD
51Test1003070TRUETRUETRUE23.3333393.3323.3393.330.00
62Test220060140TRUETRUE70

<COLGROUP><COL style="BACKGROUND-COLOR: #e0e0f0"><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
Sheet4

Worksheet Formulas
CellFormula
J5=E5/COUNTIF(F5:I5,TRUE)
K5=SUMIF(F5:F6,TRUE,$J5:$J6)

<THEAD>
</THEAD><TBODY>
</TBODY>

<TBODY>
</TBODY>


My example range is only two rows deep so adjust to suit.
Hope that helps.
 
Last edited:
Upvote 0
that is an excellent solution, thank you very much. It works great for me.

If it possible i would like to see how to make it, with the checklists. It seems more pro.. :)
 
Upvote 0
that is an excellent solution, thank you very much. It works great for me.

If it possible i would like to see how to make it, with the checklists. It seems more pro.. :)


Am I missing something?

When you say checklists I assume you mean check boxes ie check boxes in columns F G H I ?

My example shows no check boxes but assumes that they are there and are generating the TRUEs shown. s I tried to explain….

If you select each of your check boxes, in turn, select properties and set the 'Linked Cell' property to the address of the cell that the checkbox is in e.g. $F$5, $G$5 etc.
Then when you check or uncheck the checkbox the linked cell value will change automatically. Make the text of those cells White and it will not be seen but the values will allow the formulas to calculate your desired result.
 
Upvote 0
You are not missing anything! I just didnt know the true/false "function" of the checkbox.

I did it and it works perfect! Thank you very much.

Consider the ticket, closed!
 
Upvote 0

Forum statistics

Threads
1,216,038
Messages
6,128,450
Members
449,453
Latest member
jayeshw

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