Counting a cell if either OR value is met but not both.

DIZWAR

New Member
Joined
Sep 6, 2012
Messages
4
Hello,

I am gathering a large amount of data and from that data I need to extract the following:

One column has values ranging from 1 to 20 lets say A1:A500, and the 2nd column has the same values ranging from 1 to 20 (B1:B500).

What I need to do is check if say A1 or B1 is less than 11. If they are both less than 11 then it is not counted. If only one is less than 11 they it is counted. The formula then needs to do the same for all cells A2:B2, A3:B3 etc etc

Looking at the 2 columns below here is what I mean. A1 is 15 and B1 is 17 so neither count. A2 is 4 and B2 is 6 so again neither should count. A3 is 23 and A3 is 2. Only one of these is below 11 and thus would increment the count

Going through the entries below I would expect a value of 5 to be returned. Apologies for the drawn out explanation. Thanks for your help in advance.

15
17
4
6
23
2
17
12
19
16
18
20
4
1
22
6
2
21
13
7
7
1
21
19
14
8
5
9

<tbody>
</tbody>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Welcome to the board..


Try
=SUMPRODUCT(--((A1:A500<11)+(B1:B500<11)=1))
 
Upvote 0
Hi jonmo1,

That formula returns a value of 0 instead of 5. definitely feeling out of my depth on this one!!

Thanks again for your help
 
Upvote 0
Works for me.

If it's returning 0, it means none of the rows met the criteria.
Likely cause is that your numbers are not really numbers.
They are "Numbers Stored As Text"

What does this formula return
=ISNUMBER(A1)
Change A1 to a cell that appears to meet the criteria.


Excel Workbook
ABCD
115175
246
3232
41712
51916
61820
741
8226
9221
10137
1171
122119
13148
1459
Sheet1
 
Upvote 0
Sorted. I had some other data in one of the columns frm when I have messing about with it that was throwing it off.

I also now need to reference these cells to another column e.g. If A1 and B1 meet the criteria. you must only increment the count if C1 ="W". Apologies for not including everything at the beginning I didn't expect such swift assistance.
 
Upvote 0
Glad to help

Try
=SUMPRODUCT(--((A1:A500<11)+(B1:B500<11)=1),--(C1:C500="W"))
 
Upvote 0
jonmo1,

Much obliged again. Last question (maybe). I now have a value of 4 qualifying cells. What I would like to do now is from these 4 qualifying cells is reference another column that has a monetry value in and add them 4 together. Hope this makes sense.
 
Upvote 0

Forum statistics

Threads
1,215,357
Messages
6,124,483
Members
449,165
Latest member
ChipDude83

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