Dynamically create a formula from a field that contains the formula in text form

AngelCity

New Member
Joined
Sep 20, 2017
Messages
1
Hello,

I am trying to dynamically create a formula in excel.

Background:
I have created a spreadsheet that users will be populating on an ongoing basis with assessments they are making on a daily basis. To dynamically support users creating a weighted score from their daily assessments, I would need to know from what date to what date they want to perform a calculation on. As such, I would like to dynamically create a formula based on users saying, "I want to do calculations from data in row x to data in row y" - something like that.

What I have done:
I have done the below, but I am stuck on how to progress forward. Does anyone have suggestions on how I can accomplish what I am trying to do?

What I have done (i.e. the contents of some cells):

User specifies their 1st & last row:
1st Row: 9
Last Row: 18

I then dynamically create the formula that would use these rows by creating the below text:
Formula: =CONCAT("=COUNTIF(Q",B3, ":Q", B4, ",""Y"")")

=> Note, the formula I created reads as:
=COUNTIF(Q9:Q18, "Y")


Question:
How can I now execute this formula that I have dynamically created by having the user specify from what row to what row they want to count the number of "Y"s they have indicated over a couple of days or months?

Any guidance would be very much appreciated!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try using the INDIRECT function:
=COUNTIF(INDIRECT("Q"&B3&":Q"&B4),"Y")
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,307
Members
449,218
Latest member
Excel Master

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