Counting the Range of Cells by comparing its values with the values of another range

gnaga

Well-known Member
Joined
Jul 9, 2002
Messages
748
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
Hi All,

I have a two range of cells having an alphabet in each cell (R, M, N, D...)

For ex. Range 1 A10:A41 will have single Alphabet and Range 2 B10:B41 will have single or more than one alphabet (MC, MP,N,R...)

In B9 I need a formula to count number of each unique alphabet in Range 2 for the following condition

Condition
If first cell in Range 1 having R and first cell in Range 2 having any alphabet other than R then take the value as say 12
If Second cell in Range 1 having R and second cell in Range 2 having any alphabet other than R then take the value as say 12 add to the previous 12 and so on until the last cell. Display the final count in B9.

Book1
JKLMNOPQRSTU
6
7RMMDNRRNNRRange 1
832MMMDNRMNNCRange 2
9
10120000012008
Sheet1
Cell Formulas
RangeFormula
J8J8=SUM(K10:T10)
 
It signifies an array, so that the countif will work if row 3 is M or N, but it will return a count for each, so it's wrapped in sum to add them up.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Thanks for your explanation. I will try to understand this,?
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,213,549
Messages
6,114,264
Members
448,558
Latest member
aivin

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