# CountIF A1=X and B1=Y

1. ## CountIF A1=X and B1=Y

Hi, Experts. Thanks for taking a look.

Each cell in Row 1 is filled with various numbers (cells A-Z) A1=1, B1=2, C1=3, D1=1, E1=2, F1=3, G1=4...Z1=5.

Is it possible to count only those instances where 2 adjoinging cells = 1 and 2 (in a series)?

ThanksAlot!

Hello There,

Thank you!!

3. ## Re: CountIF A1=X and B1=Y

@Naren

Sorry for off-topic interjection:

Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

4. ## Re: CountIF A1=X and B1=Y

A COUNTIFS() function can do this. =COUNTIFS(A1:Y1,1,B1:Z1,2) Note how the two criteria ranges are the same size but offset by one column.

5. ## Re: CountIF A1=X and B1=Y

Narin, Thank you for your reply. Yours, indeed, worked. My space was limited, so I had to go with another solution. Cheers!

6. ## Re: CountIF A1=X and B1=Y

MrShorty, Thank you for your solution. It works perfectly. Many thanks. -Jon

There are currently 1 users browsing this thread. (0 members and 1 guests)