# COUNTIFS to count if data values in Column B are higher than the data values in Column A

Copper Contributor

# COUNTIFS to count if data values in Column B are higher than the data values in Column A

Hello,

Can someone help me with the formula needed to count the number of occurrences, wherein, the data listed in Column B is higher than the data listed in Column A?

The answer in the below example would be, 3.

6 Replies

# Re: COUNTIFS to count if data values in Column B are higher than the data values in Column A

Your attempt at using the COUNTIFS function is almost correct, but it needs a slight adjustment to work properly. COUNTIFS requires multiple conditions to be specified separately, and you cannot directly compare two ranges like B4:B8>A4:A8 within a single condition. Instead, you can use two separate conditions to achieve your goal. Here's the correct formula:

=COUNTIFS(B4:B8,">"&A4:A8)

This formula will count the number of occurrences where the values in Column B are higher than the corresponding values in Column A within the specified range.

My answers are voluntary and without guarantee!

Was the answer useful? Mark as best response and like it!

This will help all forum participants.

# Re: COUNTIFS to count if data values in Column B are higher than the data values in Column A

Thanks NikolinoDE, but that did not work.  That formula populated an array of five different numbers!  I am looking for it to return a single number, 3.

# Re: COUNTIFS to count if data values in Column B are higher than the data values in Column A

=SUMPRODUCT(N(A4:A8<B4:B8))

SUMPRODUCT returns the intended result in my sheet.

# Re: COUNTIFS to count if data values in Column B are higher than the data values in Column A

Try this.

``=SUM(--(A4:A8<B4:B8))``

# Re: COUNTIFS to count if data values in Column B are higher than the data values in Column A

Thanks OliverScheurich, your SUMPRODUCT formula accomplished my goal. I appreciate it. The user Detlef Lewin's formula also worked.

# Re: COUNTIFS to count if data values in Column B are higher than the data values in Column A

Thanks Detlet Lewin, your =SUM formula was successful. I appreciate it! The user OliverScheurich provided a formula that also worked...