Hi,
Been trying to figure out how to make a cell show a ratio in the form of 1:X
1 being a member of staff, x being the unit of work.
What I've tried:
VBA
Alongside this in the cell:
=D5/GCD(C5:D5)&":"&C5/GCD(C5:D5)
That doesn't give what I want - it simply gives the lowest factors of each number in the ratio. I want it to be 1:X (1 being 1 member of staff).
In Column D I have the # of staff assigned.
In Column C I have the units of work to be assigned evenly to the staff.
In Column E I want the ratio of the above two (i.e. the # of staff fluxuates, and when I change it, I want it to
show the ratio of work spread among the new value when I change it; so 4 staff, 20 units = 1:5. I hire someone, I change it to 5 and it updates to 1:4).
Been trying to figure out how to make a cell show a ratio in the form of 1:X
1 being a member of staff, x being the unit of work.
What I've tried:
VBA
Code:
Function GCD(numerator As Integer, denominator As Integer)
<code> If denominator = 0 Then
GCD = numerator
Else
GCD = GCD(denominator, numerator Mod denominator)
End If
End Function</code>
=D5/GCD(C5:D5)&":"&C5/GCD(C5:D5)
That doesn't give what I want - it simply gives the lowest factors of each number in the ratio. I want it to be 1:X (1 being 1 member of staff).
In Column D I have the # of staff assigned.
In Column C I have the units of work to be assigned evenly to the staff.
In Column E I want the ratio of the above two (i.e. the # of staff fluxuates, and when I change it, I want it to
show the ratio of work spread among the new value when I change it; so 4 staff, 20 units = 1:5. I hire someone, I change it to 5 and it updates to 1:4).