Count the first x number of cells

Rote Rose

New Member
Joined
May 25, 2011
Messages
3
Hello!

I try to count the number of "x" in the first 98 cells I11 to FG11 (the number of cells in the raw is variabel which is linked in cell FM7).

I used this formula:

=COUNTIF(I11:FG11,"x")-IF(COUNT(I11:FG11)>FM7,COUNTIF(INDEX(I11:FG11,COUNT(I11:FG11)-FK7),"x"),0)

this formula counts for all cells and doesn't stop after 98 cells.

Can you please tell me what's the wrong or if you have a better one?

Thanks a lot
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Welcome to the board!

Try

=COUNTIF(I11:INDEX(I11:FG11,FM7),"x")
 
Upvote 0
Hi Jasonb75,

thanks for your help. I think my problem is that I use a spreadsheet of google docs so the formula doesn't work for me. I thought that this should be the same like excel. I get the error: "unknown name range I11". The spreadsheet has a problem with the first I11 in your formula =COUNTIF(I11:INDEX(I11:FG11,FM7),"x").

Is there a possibility to add something in order for the I11 to be known as a cell?

Thanks again
 
Upvote 0
I'm not familiar with google docs but would suspect that the problem is not I11 but the index funciton appended to it.

Try

=countif(offset(I11,0,0,0,FM7),"x")
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,126
Members
452,381
Latest member
Nova88

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