COUNT BASED ON MULTIPLE CRITERIA

rhwebb

New Member
Joined
Jan 10, 2022
Messages
18
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Okay, I'm submitting a sample spreadsheet but I hope you understand my question. I'm trying to create a formula that will count based on two criteria (two separate columns). A customer number and order date are the examples provided. In short, If column A is a number AND column B is not blank then count. In the example the result should be 3. Hope this makes since and apologies but I cannot provide a copy of the actual file for security reasons. Thank you in advance.

1641952230640.png
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
If column B always date and blank cells:
Code:
=COUNTIFS($A$2:$A$100,">0",$B$2:$B$100,"<>")
 
Upvote 0
In short, If column A is a number AND column B is not blank then count. In the example the result should be 3.
Going by your sample, this should give the same result?
Excel Formula:
=COUNT(B2:B100)

.. or do you actually have some dates in column B that do not have a customer number in column A?
 
Upvote 0
Going by your sample, this should give the same result?
Excel Formula:
=COUNT(B2:B100)

.. or do you actually have some dates in column B that do not have a customer number in column A?

Hi,

Was thinking the same.

Also, might you have Repeated Customer #s in Column A, with same and/or different Order Dates in Columns B, if so, how should those be counted?
 
Upvote 0
Thank you all. I was able to find a solution by using =countif(b:b,"*/*"). On my original sheet there is a number in the date header so it was counting that. So for my case by selecting the "/" that is only located in the cells below the header I was able to narrow the count (when I used just the count the header was included thus my count was off. Now I have my answer and was able to create a Macro with concatenate that gives me the number and identifier (## customers). Loving this forum!
 
Upvote 0
Glad that you have got what you want. Thanks for letting us know. :)
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,255
Members
449,075
Latest member
staticfluids

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