gpt4 book ai didi

How to create a SUM IF BOLD formula in excel?(如何在excel中创建SUM IF BOLD公式?)

转载 作者:bug小助手 更新时间:2023-10-22 18:18:51 28 4
gpt4 key购买 nike



I want to create a formula, that combines the SUM IF (SUMMEWENN) and a SUMBOLD (SUMMEFETT) functions.

我想创建一个公式,它结合了SUMIF(SUMMEWENN)和SUMBOLD(SUMMEFETT)函数。


I already found a SUMBOLD formula from here but I don't know how to create the SUMIFBOLD (SUMMEWENNFETT) formula, can anyone tell me the vba-code?
Thank you.

我已经从这里找到了一个SUMBOLD公式,但我不知道如何创建SUMIFBOLD(SUMMEWENNFETT)公式,有人能告诉我vba代码吗?非常感谢。


更多回答

The code you point at has an if statement: If IsNumeric(Zelle.Value) Then Summe = Summe + Zelle.Value so all you need to do is add and conditions to it.

What is not working with code you point at? How have you tried to modify it? And what's your condition for SUM IF?

您所指向的代码中有什么不起作用?你是如何修改的?你的SUM IF条件是什么?

优秀答案推荐

Here is the function:

功能如下:


Function SumIfBold(rng_crit As Range, rng_sum As Range) As Double
Dim Total As Double
Dim i As Long

Total = 0 ' Initialize the total to zero

' Check if both ranges have the same number of cells
If rng_crit.Cells.Count <> rng_sum.Cells.Count Then
SumIfBold = 0 ' Return 0 if the ranges don't match
Exit Function
End If

For i = 1 To rng_crit.Cells.Count
If rng_crit.Cells(i).Font.Bold = True Then
Total = Total + rng_sum.Cells(i).Value
End If
Next i

SumIfBold = Total ' Return the total
End Function

更多回答

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com