精品丰满熟女一区二区三区_五月天亚洲欧美综合网_亚洲青青青在线观看_国产一区二区精选

  • <menu id="29e66"></menu>

    <bdo id="29e66"><mark id="29e66"><legend id="29e66"></legend></mark></bdo>

  • <pre id="29e66"><tt id="29e66"><rt id="29e66"></rt></tt></pre>

      <label id="29e66"></label><address id="29e66"><mark id="29e66"><strike id="29e66"></strike></mark></address>
      學(xué)習(xí)啦>學(xué)習(xí)電腦>工具軟件>辦公軟件學(xué)習(xí)>Excel教程>Excel函數(shù)>

      excel按照顏色進(jìn)行匯總的函數(shù)用法

      時(shí)間: 業(yè)華773 分享

        Excel中的匯總函數(shù)具體該如何按照顏色進(jìn)行計(jì)算呢?下面是由學(xué)習(xí)啦小編分享的excel按照顏色進(jìn)行匯總的函數(shù)用法,以供大家閱讀和學(xué)習(xí)。

        excel按照顏色進(jìn)行匯總的函數(shù)用法:

        按照顏色進(jìn)行匯總步驟1:在EXCEL界面中,按下組合鍵 Alt + F11,彈出一個(gè)MicrosoftVisual Basic窗口。

        按照顏色進(jìn)行匯總步驟2:在窗口中,執(zhí)行菜單操作:“插入”—>“模塊”,如下圖。

        按照顏色進(jìn)行匯總步驟3:看到一個(gè)“(通用)”的窗體,這個(gè)窗體就是用來輸入VBA代碼的窗體,如下圖:

        按照顏色進(jìn)行匯總步驟4:將如下代碼粘貼到該窗體中:

        FunctionSumByColor(Ref_color As Range, Sum_range As Range)

        Application.Volatile

        Dim iCol As Long

        Dim rCell As Range

        SumByColor = 0

        iCol =Ref_color.Interior.ColorIndex

        For Each rCell InSum_range

        If iCol = rCell.Interior.ColorIndex And WorksheetFunction.IsNumber(rCell) Then

        SumByColor = SumByColor + rCell.Value

        End If

        Next rCell

        End Function

        結(jié)果如下圖:

        按照顏色進(jìn)行匯總步驟5:關(guān)閉Microsoft VisualBasic窗口,返回到EXCEL窗口,函數(shù)SumByColor設(shè)置完畢。

        設(shè)置完成的函數(shù)SumByColor(Ref_color, Sum_range),函數(shù)有2個(gè)參數(shù):

        第一個(gè)是要想統(tǒng)計(jì)顏色的單元格(任意一個(gè)與要匯總顏色相同的單元格均可),

        第二個(gè)是要匯總的單元格區(qū)域。

        如本例,在B16格中輸入: =SumByColor(B15,B2:F13) 得出結(jié)果:1690748

      787920