Conditional count based on values in top row

piannetta

New Member
Joined
Aug 27, 2002
Messages
42
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to count the number of times the letter "O" appears in any column where the first row =1, then 2, and so on:

I've been playing around with =countifs() and variations of nested =countif() without luck.

Does anyone have any tips to help me with this please?

Cheers,
Pete
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I think I've figured it out using the offset function:

=COUNTIF(OFFSET($LE$8,1,LF2,392,LG2-LF2),"O")

Where...
LE8 being the top-left corner outside of the range I'm interested in
LF2 = the number of columns in the count range (a formula that returns the starting column number of the next set of columns to be counted)
LG2 - LF2 = a formula to work out how many columns are in the count range
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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