Cell value in COUNTIF range?

EssKayKay

Active Member
Joined
Jan 5, 2003
Messages
445
Office Version
  1. 2007
Platform
  1. Windows
Hello,

Is it possible to include the value of a cell in the COUNTIF range?

I have a couple formulas counting the number of cells in a range that are > 1. I can hardcode in the range. However, the last cell in the range can change. The column remains constant. The last row value is in cell T13.

Example:
This “hardcoded” version works fine; however the S113 location can change –
=COUNTIF(S33:S113,">1")

Something like this is what I had in mind –
=COUNTIF(S33:S: & range(“T13”).value,">1")


Thanks for viewing,
Steve K.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
you can use a indirect() to find the range
I assume that T13 will have something like S113 within it ? - IS that correct?
OR does T13 just have a number in and you want to be the row , as shown in your example
OR
just use a range larger then likely to find
=COUNTIF(S33:S10000,">1")

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Last edited:
Upvote 0
=COUNTIF(INDIRECT("S33:"&T13),">"&1) - assuming T13 has S in
OR
=COUNTIF(INDIRECT("S33:S"&T13),">"&1) = assuminf T13 is just a number

Book2
ST
13135
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
332
34
35
36
Sheet1
Cell Formulas
RangeFormula
S13S13=COUNTIF(INDIRECT("S33:S"&T13),">"&1)
 
Upvote 0
Solution
Thank you etaf for getting back to me.

The reason I didn't just use a larger number is because there could be other cells populated beyond the last row noted in cell T13. I only want to address the range S33 through S (last row).

Your second formula is exactly what I had in mind. The reason it only contains the row number and not the column letter is because T13's value is used in other formulas addressing different columns with the row noted in T13.

Thanks again,
SKK
 
Upvote 0

Forum statistics

Threads
1,225,969
Messages
6,188,109
Members
453,460
Latest member
Cjohnson3

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