Forum Discussion

abhinair's avatar
abhinair
Copper Contributor
Apr 07, 2023
Solved

COUNTIFS Help Needed

Hi,   I am using the COUNTIFS formula below but running into #VALUE! error =COUNTIFS('Raw Data'!$A:$A,'Composite by Relation'!$A2,'Raw Data'!$E:$T,">0",'Raw Data'!$D:$D,C2)   Use Case: I have 2...
  • JosWoolley's avatar
    JosWoolley
    Apr 08, 2023

    abhinair 

     

    Obtaining the average using only the IFS family of functions would be more convoluted:

     

    =LET(
        α,'RawData'!$A:$A,
        β,'RawData'!$D:$D,
        γ,OFFSET('RawData'!$E:$E,,SEQUENCE(,COLUMNS('RawData'!$E:$T),0)),
        SUM(SUMIFS(γ,γ,">0",α,$A2,β,C2))/SUM(COUNTIFS(α,$A2,γ,">0",β,C2))
    )

     

    I'd prefer:

     

    =AVERAGE(
        IF('RawData'!$A2:$A100=$A2,
            IF('RawData'!$D2:$D100=C2,
                IF('RawData'!$E2:$T100>0,'RawData'!$E2:$T100)
            )
        )
    )

     

    keeping the end row reference to a suitably low upper bound.

     

    Regards

Resources