Modifying an existing formula to use a dynamic range

caf

New Member
Joined
Jun 28, 2011
Messages
1
I use the following formula every day to count the number of blank cells in column-G. The range in column-g varies every day and I am just curious if there's a way to edit the formula to make it use a dynamic range rather than editing it every single day?

=COUNTIF('Raw_Data_2011'!G2:G923,"")
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Welcome to the board caf,

First create the dynamic range. Ctrl-F3 -> New -> Set Name to ex. "dynamicRange" -> set Refers To
Code:
=OFFSET($G$2,0,0,COUNTA($A2:$A65536),1)
Using column A in COUNTA as an example but it should be a column that contains data in all rows up to the desired end row.

Then either use your formula
Code:
=COUNTIF(dynamicRange,"")
or
=COUNTBLANK(dynamicRange)
 
Upvote 0
I use the following formula every day to count the number of blank cells in column-G. The range in column-g varies every day and I am just curious if there's a way to edit the formula to make it use a dynamic range rather than editing it every single day?

=COUNTIF('Raw_Data_2011'!G2:G923,"")

Is the column supposed to house text values? If so:

=COUNTIF('Raw_Data_2011'!G2:INDEX('Raw_Data_2011'!G:G,MATCH(REPT("z",255),'Raw_Data_2011'!G:G)),"")
 
Upvote 0
I use the following formula every day to count the number of blank cells in column-G. The range in column-g varies every day and I am just curious if there's a way to edit the formula to make it use a dynamic range rather than editing it every single day?

=COUNTIF('Raw_Data_2011'!G2:G923,"")
You could but one good thing about the COUNTIF function is that it will only calculate based on the used range.

For example...

=COUNTIF('Raw_Data_2011'!G:G,"")

You're referencing the ENTIRE column but if you only have data down to row 25 then Excel is smart enough to only evaluate the range as:

=COUNTIF('Raw_Data_2011'!G1:G25,"")

That way it calculates more efficiently by not having to evaluate a bunch of empty unused cells.

The best way to define a dynamic range range depends on several factors.

What type of data will the range contain? Is it text? Numbers? Could be both?

Is the data entered in a contiguous block (no empty cells within the data range)?

Are there any formulas in this range? Do any of the formulas return formula blanks ("") ?
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,856
Members
452,948
Latest member
UsmanAli786

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