Problems with Countif and named range

thisisnotluisa

New Member
Joined
Jun 28, 2016
Messages
7
So this is what I have for my named range:

Public Sub Change_Range()


ActiveWorkbook.Names.Add Name:="range_test", _
RefersTo:="'UK WWTWs'!$H$3:$H$" & Sheets("BusinessModel").Range("C47")


End Sub

And this allows me to change the end range of the range_test. And in C47 I have the value of 10.

When I put =range_test in a cell this shows: 'UK WWTWs'!$H$3:$H$10"


But I'm trying to find a value between two numbers and have put this:

=COUNTIF(range_test,">="&K55)-COUNTIF(range_test,">="&M55)

And when I press enter I keep getting #VALUE!

I tried putting range_test into something similar like SUM(range_test) and I get #VALUE! again.

How can I fix this?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Change your refers to bit to:

RefersTo:=Range("'UK WWTWs'!$H$3:$H$" & Sheets("BusinessModel").Range("C47"))
 
Upvote 0
Try
Code:
ActiveWorkbook.Names.Add Name:="range_test", _
 RefersTo:="[B][COLOR="#FF0000"]=[/COLOR][/B]'UK WWTWs'!$H$3:$H$" & Sheets("BusinessModel").Range("C47")
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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