I have a spreadsheet showing data for each state, by year (in long format), like so:
STATE YEAR COUNT
AL 2000 5
AL 2001 ---
AL 2002 4
AK 2000 8
AK 2001 2
AK 2002 3
etc.
There is always the same 3 years of data for every State. For each State, I'd like to count across the 3 rows of data and if any value in Column C is equal to "---", then return a 0 in Column D for all 3 rows. Otherwise, return a 1.
For example:
STATE YEAR COUNT RESULT
AL 2000 5 0
AL 2001 --- 0
AL 2002 4 0
AK 2000 8 1
AK 2001 2 1
AK 2002 3 1
etc.
I tried using the CountIF function, but couldn't figure out how to tell Excel to apply it separately for every 3 rows of data. Any ideas? Thank you.
Bookmarks