Sort without altering cell index

2019-08-14 03:39发布

I am looking for a solution to following issue :

I want to know the sum of A/Cs 3, 4 and 5 all the time in H7 (In Picture). But, I will also want to sort the date occasionally to verify the next due but without affecting H7

Before sort

But, What actually happens when sorting in ascending order, the Cell index itself is getting changed and the value at H7 gives me the different value (which is not what I want).

After Sort

Is it possible to freeze the Cell index during sort?

2条回答
爷、活的狠高调
2楼-- · 2019-08-14 03:54

Try a SUMIF function with OR criteria.

=SUM(SUMIF(A:A, {3,4,5}, B:B ))
查看更多
干净又极端
3楼-- · 2019-08-14 03:59

Use the formula to calculate total: =SUMIFS(B4:B8,A4:A8,">=3",A4:A8,"<=5")

What this does is it adds the values in the range B4:B8 only when values in range A4:A8 is greater than or equal to 3 and less than or equal to 5.

查看更多
登录 后发表回答