Count cells above yes/no last ten

Weefergie56

New Member
Joined
Jan 26, 2024
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hi I want to count the number of yes answers in the last ten cells above that would not count any blank cells as part of the ten. I have found versions but they don't work if the formula is directly below it. Cany anyone help, please? This one works but not underneath the columns which is what I need. Thank you.

=COUNTIF(INDEX(G:G,MAX(MATCH("z", G:G)-9,1)):INDEX(G:G, MATCH("z", G:G)), "Yes")
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Without seeing your data, I'd have to take a guess based on your description. Try
Excel Formula:
=SUM(--(TAKE(TOCOL(G:G,1),-10)="Yes"))
 
Upvote 0
Thanks, it's giving me a name error. I will try later ro add a mini sheet for data example.
 
Upvote 0
Hi - I have attached a screenshot. Hopefully you can help if you are still interested. Thank you!
 

Attachments

  • SS - no formula.PNG
    SS - no formula.PNG
    20.5 KB · Views: 12
  • SS - formula.PNG
    SS - formula.PNG
    22 KB · Views: 12
Upvote 0
Have you tried my suggested formula?
Book2
G
1Yes
2
3
4
5
6
7Yes
8Yes
9No
10No
11Yes
12Yes
13Yes
14Yes
15No
167
Sheet3
Cell Formulas
RangeFormula
G16G16=SUM(--(TAKE(TOCOL(G1:G15,1),-10)="Yes"))
 
Upvote 0
Have you tried my suggested formula?
Book2
G
1Yes
2
3
4
5
6
7Yes
8Yes
9No
10No
11Yes
12Yes
13Yes
14Yes
15No
167
Sheet3
Cell Formulas
RangeFormula
G16G16=SUM(--(TAKE(TOCOL(G1:G15,1),-10)="Yes"))
Yes but I get a name error. The column has a heading name. Say it is called "Correct" so I adjusted the formula to start from G2. Another issue might be that I am likely to add more rows so the range would change...
 
Upvote 0
Yes but I get a name error. The column has a heading name. Say it is called "Correct" so I adjusted the formula to start from G2. Another issue might be that I am likely to add more rows so the range would change...
1) The #NAME error could result from either misspelling the function names or you're not using XL 365.
2) Depending on you're adding more rows, the formula can auto-adjust the range.
 
Upvote 0
Yes I am not using 365. It is 2016.
Then you should update your profile to reflect that:
1715265917139.png


If you typically use 365, but just using 2016 for this question, then it is fine to leave your Profile as-is, but be sure to mention in this question what version you are using.
As you can see, certain solutions work in some versions and not others, which is why it is important for responders to know exactly which version you are using for this.
 
Upvote 0
Apologies that is what I use at home. This is for another area.

I will take my telling off and try to remember next time.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
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