how to dynamically reference a cell

vladi305

Board Regular
Joined
Jan 12, 2023
Messages
88
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Ok I have the following formula: =COUNTIF(Data!B$1:F$30,[@Ball])

I want to from a drop down menu change the range of the F cell to 40, 60 or any range

=COUNTIF(Data!B$1:F$& C2 ,[@Ball])
=COUNTIF(Data!B$1:F$&"C2",[@Ball])

I tried but I keep getting errors

Thanks in advance
 

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.
How about
Excel Formula:
=COUNTIF(Data!B$1:INDEX(Data!B$:F$, C2) ,[@Ball])
 
Upvote 0

Attachments

  • 20230217_162443.jpg
    20230217_162443.jpg
    69.2 KB · Views: 6
Upvote 0
Oops, it should be
Excel Formula:
=COUNTIF(Data!B$1:INDEX(Data!F:F, C2) ,[@Ball])
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,917
Members
449,055
Latest member
KB13

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