Heed: I don’t know if this is due to the Excel version, but in my Excel
in Portuguese (version 14.0.7149.5000 32 bits of Office 2010) nay
exists a function called CONTAR.SE.S
. The function that exists in my
Excel is CONT.SES
(and so I use it in the example). Still,
Assuming your role is with the correct name, the answer
is still valid (simply change the function name).
The function CONT.SES, Counting with multiple criteria, allows you to count using multiple criteria and multiple intervals. So, to have the calculation that you want to just do three counts:
- Count the values in column E that are within the interest ranges of that column
- Count the values in column F that are within the interest ranges of that column
- Count the values in both columns within their respective ranges.
If you add up the values of (1) and (2), it will almost always be right, except when the exceptions you mention occur (the values of both columns E and F on a given row are both accepted). These exceptions are accounted for by (3), so just subtract this value from the previous sum.
For example:
=CONT.SES(E:E;">120";E:E;"<139")+CONT.SES(F:F;">80";F:F;"<89")-CONT.SES(E:E;">120";E:E;"<139";F:F;">80";F:F;"<89")
To avoid the values being fixed in the formula, you may want to configure other cells with these values (for example, cells I1, J1, K1 and L1). In that case, make the formula like this:
=CONT.SES(E:E;">"&I1;E:E;"<"&J1)+CONT.SES(F:F;">"&K1;F:F;"<"&L1)-CONT.SES(E:E;">"&I1;E:E;"<"&J1;F:F;">"&K1;F:F;"<"&L1)
Here is an example of a spreadsheet (which you could have provided - would greatly facilitate the life of anyone who would help you), with the result (the cells "In E", "In F" and "In E and F" contain the partial formulas to demonstrate the results on each previously exposed item). The line indicated by the arrow in red is the only one where the conditions are met in both columns.
I deleted my answer because I saw that she was not answering your question. However the ideal would be for you to add the information you gave me to your question explaining a little better what your ultimate goal is. If you want I’ll glue here your last comment.
– Math
Just one detail I ended up repeating the column
E
in my reply, the right would be=CONTAR.SE.S(E:E;">120";E:E;"<139")+CONTAR.SE.S(F:F;">80";F:F;"<89")
, However, I think what you want is for the condition to be made line by line, right? That is, if E1 meets the condition no need to check the condition in F1.– Math
Exactly @Math
– Ricardo Simoes