Pergunta

I have a question regarding excel, for which I could not find an answer on the internet:

I have a data source sheet like this:

Cat - V1 - V2 -

01 | 10 | 11 |
02 | 12 | 10 |
03 | 10 | 23 |
01 | 11 | 10 |
02 | 23 | 30 |
03 | 30 | 12 |

Then there is a result sheet on which I want to do some calculations:

Category | number of times V1 is bigger than V2

01 | 1
02 | 1
03 | 1

So I need a formula that counts the number of times V1 is bigger than V2 per category. I tried this: COUNTIFS(B:B;"<"&C:C;A:A;D1)
Where the value of D1 is category 01. This obviously doesn't work because now the total amount of comun B and C are compared.

Can anybody help me with this? (the story is actually a bit more complex with multiple SUMIFS, but my issue is to do a check per row and create a summary on the results. The source data is imported over and over, so I need to do the calculations on a different sheet)

Kind regards,

Foi útil?

Solução

Try this one:

=SUMPRODUCT(($A$1:$A$6=D1)*($B$1:$B$6>$C$1:$C$6))

I don't recomend you to use entire columns in formula, i.e. B:B, because it makes formula very slow.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top