Query refresh is altering COUNTIFS range

eclpbarney

New Member
Joined
Jul 23, 2009
Messages
1
I have built a dashboard sheet that references information on other sheets that are updated by refreshing queries against TFS.

At times (but not always), my dashboard cells will bang out to #VALUE! because my formula

=COUNTIFS('Sheet2'!$A$3:$A$5000,$B4,'Sheet2'!$K$3:$K$5000,F$3)

becomes

=COUNTIFS('Sheet2'!$A$3:$A$5000,$B4,'Sheet2'!$K$3:$K$5001,F$3)

it tends to be off by 1, but sometimes more. but it's always criteria range 2 that changes
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Perhaps your query RefreshStyle is set to insert rows, rather than overwrite them and the in-cell formula adapts to the moved last row.

RefreshStyle Property

Returns or sets the way rows on the specified worksheet are added or deleted to accommodate the number of rows in a recordset returned by a query. Read/write XlCellInsertionMode.
<table><tbody><tr><td>XlCellInsertionMode can be one of these XlCellInsertionMode constants.</td></tr><tr><td>xlInsertDeleteCells. Partial rows are inserted or deleted to match the exact number of rows required for the new recordset.</td></tr><tr><td>xlOverwriteCells. No new cells or rows are added to the worksheet. Data in surrounding cells is overwritten to accommodate any overflow.</td></tr><tr><td>xlInsertEntireRows. Entire rows are inserted, if necessary, to accommodate any overflow. No cells or rows are deleted from the worksheet.</td></tr></tbody></table>
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,733
Members
448,987
Latest member
marion_davis

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