Excel count unique in range if

后端 未结 1 585
伪装坚强ぢ
伪装坚强ぢ 2021-01-28 22:04

What formula can be used to count unique values in column A if Column B is a value. i have seen many online but none of them seem to work when only using Column ranges , the dat

相关标签:
1条回答
  • 2021-01-28 22:25

    If your data are in A1:B18, and criteria1 is in C1, try:

    {=SUM(IF(FREQUENCY(IF(A1:A18<>"", IF(B1:B18=C1, MATCH(A1:A18, A1:A18, 0))), ROW(A1:A18)-ROW(A1)+1), 1))}
    

    Expanded:

    {=SUM(
        IF(
            FREQUENCY(
                IF(A1:A18<>"", 
                    IF(B1:B18=C1, 
                        MATCH(A1:A18, A1:A18, 0)
                    )
                ), 
                ROW(A1:A18)-ROW(A1)+1
            ), 
        1)
    )}
    

    Enter as an array formula with CtrlShiftEnter

    0 讨论(0)
提交回复
热议问题