怎样用EXCEL求和时间?例如分秒这种时间的求和?谢谢!!!
发布网友
发布时间:2022-04-24 03:25
我来回答
共3个回答
热心网友
时间:2023-10-24 18:58
假设你时间在A列
B1输入公式 =--SUBSTITUTE(SUBSTITUTE(A1,"秒",".",1),"分",":",1)
向下填充,
选中B列 右键设置单元格格式 自定义 输入 mm:ss.00
然后对B列求和,就行了
热心网友
时间:2023-10-24 18:58
假设你时间在A列
B1输入公式 =--SUBSTITUTE(SUBSTITUTE(A1,"秒",".",1),"分",":",1)
向下填充,
选中B列 右键设置单元格格式 自定义 输入 mm:ss.00
然后对B列求和,就行了
热心网友
时间:2023-10-24 18:59
先把时间调整成以下格式,时:分:秒:毫秒 1:20:30:567
然后ALT+F11,进入EXCEL VBA
这是个时间函数的求和,和普通的SUM用法一样,之不过函数名是 tsum
Function tsum(rng As Range) '自定义函数
Dim sum1%, sum2%, sum3%, sum4%
Dim sum11$, sum22$, sum33$, sum44$
sum1 = 0: sum2 = 0: sum3 = 0: sum4 = 0
Application.Volatile
On Error Resume Next
For Each c In rng
a = Split(c, ":")
sum4 = sum4 + Val(a(UBound(a)))
sum3 = sum3 + Val(a(UBound(a) - 1))
sum2 = sum2 + Val(a(UBound(a) - 2))
sum1 = sum1 + Val(a(UBound(a) - 3))
Next
sum44 = Format(sum4 Mod 1000, "000")
sum33 = Format((sum4 \ 1000 + sum3) Mod 60, "00")
sum22 = Format(((sum4 \ 1000 + sum3) \ 60 + sum2) Mod 60, "00")
sum11 = ((sum4 \ 1000 + sum3) \ 60 + sum2) \ 60 + sum1
tsum = sum11 & ":" & sum22 & ":" & sum33 & ":" & sum44
End Function
热心网友
时间:2023-10-24 18:59
直接求和 函数 =sum()
热心网友
时间:2023-10-24 18:59
先把时间调整成以下格式,时:分:秒:毫秒 1:20:30:567
然后ALT+F11,进入EXCEL VBA
这是个时间函数的求和,和普通的SUM用法一样,之不过函数名是 tsum
Function tsum(rng As Range) '自定义函数
Dim sum1%, sum2%, sum3%, sum4%
Dim sum11$, sum22$, sum33$, sum44$
sum1 = 0: sum2 = 0: sum3 = 0: sum4 = 0
Application.Volatile
On Error Resume Next
For Each c In rng
a = Split(c, ":")
sum4 = sum4 + Val(a(UBound(a)))
sum3 = sum3 + Val(a(UBound(a) - 1))
sum2 = sum2 + Val(a(UBound(a) - 2))
sum1 = sum1 + Val(a(UBound(a) - 3))
Next
sum44 = Format(sum4 Mod 1000, "000")
sum33 = Format((sum4 \ 1000 + sum3) Mod 60, "00")
sum22 = Format(((sum4 \ 1000 + sum3) \ 60 + sum2) Mod 60, "00")
sum11 = ((sum4 \ 1000 + sum3) \ 60 + sum2) \ 60 + sum1
tsum = sum11 & ":" & sum22 & ":" & sum33 & ":" & sum44
End Function
热心网友
时间:2023-10-24 18:59
直接求和 函数 =sum()
热心网友
时间:2023-10-24 18:58
假设你时间在A列
B1输入公式 =--SUBSTITUTE(SUBSTITUTE(A1,"秒",".",1),"分",":",1)
向下填充,
选中B列 右键设置单元格格式 自定义 输入 mm:ss.00
然后对B列求和,就行了
热心网友
时间:2023-10-24 18:59
先把时间调整成以下格式,时:分:秒:毫秒 1:20:30:567
然后ALT+F11,进入EXCEL VBA
这是个时间函数的求和,和普通的SUM用法一样,之不过函数名是 tsum
Function tsum(rng As Range) '自定义函数
Dim sum1%, sum2%, sum3%, sum4%
Dim sum11$, sum22$, sum33$, sum44$
sum1 = 0: sum2 = 0: sum3 = 0: sum4 = 0
Application.Volatile
On Error Resume Next
For Each c In rng
a = Split(c, ":")
sum4 = sum4 + Val(a(UBound(a)))
sum3 = sum3 + Val(a(UBound(a) - 1))
sum2 = sum2 + Val(a(UBound(a) - 2))
sum1 = sum1 + Val(a(UBound(a) - 3))
Next
sum44 = Format(sum4 Mod 1000, "000")
sum33 = Format((sum4 \ 1000 + sum3) Mod 60, "00")
sum22 = Format(((sum4 \ 1000 + sum3) \ 60 + sum2) Mod 60, "00")
sum11 = ((sum4 \ 1000 + sum3) \ 60 + sum2) \ 60 + sum1
tsum = sum11 & ":" & sum22 & ":" & sum33 & ":" & sum44
End Function
热心网友
时间:2023-10-24 18:59
直接求和 函数 =sum()
热心网友
时间:2023-10-24 18:58
假设你时间在A列
B1输入公式 =--SUBSTITUTE(SUBSTITUTE(A1,"秒",".",1),"分",":",1)
向下填充,
选中B列 右键设置单元格格式 自定义 输入 mm:ss.00
然后对B列求和,就行了
热心网友
时间:2023-10-24 18:59
先把时间调整成以下格式,时:分:秒:毫秒 1:20:30:567
然后ALT+F11,进入EXCEL VBA
这是个时间函数的求和,和普通的SUM用法一样,之不过函数名是 tsum
Function tsum(rng As Range) '自定义函数
Dim sum1%, sum2%, sum3%, sum4%
Dim sum11$, sum22$, sum33$, sum44$
sum1 = 0: sum2 = 0: sum3 = 0: sum4 = 0
Application.Volatile
On Error Resume Next
For Each c In rng
a = Split(c, ":")
sum4 = sum4 + Val(a(UBound(a)))
sum3 = sum3 + Val(a(UBound(a) - 1))
sum2 = sum2 + Val(a(UBound(a) - 2))
sum1 = sum1 + Val(a(UBound(a) - 3))
Next
sum44 = Format(sum4 Mod 1000, "000")
sum33 = Format((sum4 \ 1000 + sum3) Mod 60, "00")
sum22 = Format(((sum4 \ 1000 + sum3) \ 60 + sum2) Mod 60, "00")
sum11 = ((sum4 \ 1000 + sum3) \ 60 + sum2) \ 60 + sum1
tsum = sum11 & ":" & sum22 & ":" & sum33 & ":" & sum44
End Function
热心网友
时间:2023-10-24 18:59
直接求和 函数 =sum()