
4 4 4 4 16 6.15 6.15 6.15 6.15 10 6.15 41.15 6.15 6.15 7 6.15 10 6.15 42.00 6.15 4 6.15 6.15 10 6.15 39.00 |
=SOMMA(INT(SOMMA(A1:F1))+RESTO(SOMMA(A1:F1);1)/60*100)/24 4 4 4 4 16.00 6,15 6,15 6,15 6,15 10 6,15 41.15 6,15 6,15 10 6,15 20 6,15 55.00 6,15 1 6,15 6,15 10 6,15 36.00 |
Function Somma_Ore_By_Pv(ELENCO As Range) As Double Dim cc As Range valore = 0 intero = 0 intero2 = 0 For Each cc In ELENCO decimale = cc.Value - Int(cc.Value) intero2 = intero2 + Int(cc.Value) valore = valore + decimale If valore >= 0.6 Then intero = intero + 1 valore = valore - 0.6 End If Next If valore = "0,6" Then valore = 1 End If Somma_Ore_By_Pv = intero2 + intero + valore Somma_Ore_By_Pv = Format(Somma_Ore_By_Pv, "#,##0.00") End Function |
Function CalcoloOre(ParamArray par()) As Long Dim i As Integer For i = 1 To UBound(par) CalcoloOre = CalcoloOre + ((int(par(i)) + (par(i) % 1)/60*100)/24 Next i End Function |
''INSERIRE IN UN MODULO in cella di calcolo come =somma() =Sum_OV()
Function Sum_OV(celle_di_calcolo As Range) As Double ''calcola ore con valore numerico
Dim cc As Range
dec1 = 0
dec2 = 0
somma = 0
For Each cc In celle_di_calcolo
dec1 = cc.Value - Int(cc.Value) ''val dec
dec2 = somma - Int(somma) ''val dec prima immissione
decsom = dec1 + dec2
If decsom >= 0.6 Then
somma = somma + 1 + cc.Value - 0.6
Else
somma = somma + cc.Value
End If
Next
Sum_OV = (Int(somma) + ((somma - Int(somma)) / 60 * 100)) / 24 ''cella formattata [h].mm
'' ritorna ore.minuti
End Function
|
If valore = "0,6" Then valore = 1 End If ''Somma_Ore_By_Pv = intero2 + intero + valore ''Somma_Ore_By_Pv = Format(Somma_Ore_By_Pv, "#,##0.00") somme_celle = intero2 + intero + valore Somma_Ore_By_Pv = (Int(somme_celle) + ((somme_celle - Int(somme_celle)) / 60 * 100)) / 24 End Function |
