Google-sheets – Comparing data changes over time

formulasgoogle sheetsgoogle-sheets-arrayformula

Let’s say I’ve collected data on a scale of bins from 1-6 at two different time periods (T1 & T2), organized as two columns in Google Sheets:

T1      T2

1       2

1       5

2       3 

5       6 

1       2

Say I want to compare how many in bin 1 moved to bin 2 between Time 1 and Time 2. How I would calculate this sum in Google Sheets?

Secondly, let’s say I have some data points missing, like so…

T1      T2

1       2

1       [___]

2       3 

5       [___] 

1       2

How would I exclude rows 2 and 4 in Google Sheets in an equation without removing them from the dataset manually? (in an equation like arrayformula(range1-range2) for example). Since they are missing data, I need to exclude them altogether.

Best Answer

=ARRAYFORMULA(IF(LEN(B2:B&A2:A), B2:B-A2:A, ))

0


=ARRAYFORMULA(IF(LEN(B2:B)*LEN(A2:A), B2:B-A2:A, ))

0