Forum Discussion

LouiseWard29's avatar
LouiseWard29
Copper Contributor
Mar 04, 2025
Solved

How to count if there is a yes in either of 2 columns

I'm a newbie at Excel and don't even know how to frame this question properly, so forgive me!  I have a spreadsheet of students enrolled in various classes.  There is a separate column for each unit...
  • HansVogelaar's avatar
    Mar 04, 2025

    If the data are in adjacent columns, for example E2:F100:

    =SUM(BYROW(E2:F100, LAMBDA(r, --OR(r="Yes"))))

    Alternatively, create a helper column, for example in column Z: if the data are in E2:E100 and G2:G100, enter

    =--OR(E2="Yes", G2="Yes")

    in Z2, and fill down to Z100. You can then use =SUM(Z2:Z100) for the count.

Resources