Count two values in different cells within the same row

rhettblaine

New Member
Joined
Oct 3, 2013
Messages
29
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I'm trying to count how many times two different values appear in the same row and return those results in the same row. My obvious go to was COUNTIFS but that only works when it's one criteria; once I add an additional Criteria it will return 0. I've tried using SUMPRODUCT but receive the same results.

I also did not create the data source (A1 to H4 in my example below) so I'm having to get creative (I1:L4) so that I can create graphs, etc.

Due to the sensitivity of the data, I cannot post an exact replica of my table.


ABCDEFGHIJKL
1CustomerOrder DateItem 1Status 1Item 2Status 2Item 3Status 3T-ShirtPendingDeliveredCanceled
2Customer 1Nov 4, 2022T-ShirtPendingHoodieDeliveredHatCanceled1100
3Customer 2Nov 5, 2022T-ShirtDeliveredT-ShirtPendingHatPending2110
4Customer 3Dec 12, 2022T-ShirtCanceledT-ShirtCanceledT-ShirtDelivered1012
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Hi can you please explain what you want to count?
 
Upvote 1
Is this what you want.
Fluff.xlsm
ABCDEFGHIJKL
1CustomerOrder DateItem 1Status 1Item 2Status 2Item 3Status 3T-ShirtPendingDeliveredCanceled
2Customer 1Nov 4, 2022T-ShirtPendingHoodieDeliveredHatCanceled1100
3Customer 2Nov 5, 2022T-ShirtDeliveredT-ShirtPendingHatPending2110
4Customer 3Dec 12, 2022T-ShirtCanceledT-ShirtCanceledT-ShirtDelivered3012
Lists
Cell Formulas
RangeFormula
I2:I4I2=COUNTIFS(C2:G2,I$1)
J2:L4J2=COUNTIFS($C2:$G2,$I$1,$D2:$H2,J$1)
 
Upvote 1
Is this what you want.
Fluff.xlsm
ABCDEFGHIJKL
1CustomerOrder DateItem 1Status 1Item 2Status 2Item 3Status 3T-ShirtPendingDeliveredCanceled
2Customer 1Nov 4, 2022T-ShirtPendingHoodieDeliveredHatCanceled1100
3Customer 2Nov 5, 2022T-ShirtDeliveredT-ShirtPendingHatPending2110
4Customer 3Dec 12, 2022T-ShirtCanceledT-ShirtCanceledT-ShirtDelivered3012
Lists
Cell Formulas
RangeFormula
I2:I4I2=COUNTIFS(C2:G2,I$1)
J2:L4J2=COUNTIFS($C2:$G2,$I$1,$D2:$H2,J$1)

Correct, that's the results that I'm expecting. I've tried that formula but I keep receiving 0 when there should be a count.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Check that you don't have any leading/trailing spaces in the data.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Check that you don't have any leading/trailing spaces in the data.
Thanks Fluff!

I've updated my info.

I'm using version 365.

I've also checked for leading/trailing spaces, they all match; spelling is correct; used Len also to make sure, all matches.

The table that contains the data is a connection to a SharePoint list. The columns where I'm placing the formulas are an extension of the table. So, using my example table above, A:H are from SharePoint, and I:L are extended parts of the table that contain the formula.
 
Upvote 0
Is the formula in the same workbook as the data?
 
Upvote 0
Is the formula in the same workbook as the data?
Yes, it is.

As long as I don't add additional criteria to the COUNTIFS formula it works:

=COUNTIFS($D2:$H2,J$1) (WORKS)

=COUNTIFS($C2:$G2,$I$1,$D2:$H2,J$1) (DOES NOT WORK)


Edit

I also just tried using it outside of a table. COUNTIFS still does returns a count of 0.
 
Last edited:
Upvote 0
Does this work
Excel Formula:
=COUNTIFS($C2:$G2,$I$1)
 
Upvote 0

Forum statistics

Threads
1,215,518
Messages
6,125,293
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top