How to count cells in a range with a value less than another cell in excel?

前端 未结 3 1746
陌清茗
陌清茗 2020-11-30 15:37

My Table looks like below

\"enter

if \"team1\" value is less than \"general\"

3条回答
  •  日久生厌
    2020-11-30 15:46

    EDIT: merged two answers here:

    This formula will do what you are looking for, assuming you move everything one column to the right (adding an empty column in column A):

    =SUM(IF(C2:AK2="Team1";IF(C3:AK3 < B3:AJ3;1;0)))
    

    What this does is that it first looks if you have Team1 in the column. It then proceeds to check if the data below is less than the one preceding that. It is important you have the last if as A and the others as B because otherwise it will summarise the wrong data. (For team2 you will have to change the last B3:AJ3 to A3:AI3)

    Also, use shift+enter when you enter this to make sure it becomes an array formula.


    I would highly recommend you switch your columns and rows to a more standardised form first in order to have an easier workflow with your data. I mean something like thisthis

    I would then recommend you check out the answer for a similar question here. To summarise, you gather the data in one column and then use a

    =SUM(IF(B:B < A:A;1;0)) 
    

    assuming you have team1 in column B and general in column A.

提交回复
热议问题