How to Filter Rows with Formulas including Cell Reference

Snixerdoodle

New Member
Joined
Nov 3, 2017
Messages
3
I currently have a formula that references cells on another sheet based on multiple criterias. After much googling I've gotten it to work properly however I now need to sort the data without affecting the values.
Currently if I sort as normal, the values change due to the cell references changing with the sort.

I know a simple fix is to simply copy and paste the values only and then sort them however I'd like to avoid that.

Here is my formula:<!-- BEGIN TEMPLATE: bbcode_code -->
<code>=COUNTIFS('Test Sheet'!A2:'Test Sheet'!A9818, ">="&A2,'Test Sheet'!A2:'Test Sheet'!A9818,"<="&C2,'Test Sheet'!J2:'Test Sheet'!J9818,A4)</code>


<!-- END TEMPLATE: bbcode_code -->Here is a copy of my Excel sheet minus any sensitive information:
https://www.dropbox.com/s/btrna04gc8...Test.xlsx?dl=0

Thank you in advanced!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hi ,

I do not know which range you wish to sort , but the first thing to do is to revise your formula so that it reads :

=COUNTIFS('Test Sheet'!$A$2:'Test Sheet'!$A$9818, ">="&$A$2,'Test Sheet'!$A$2:'Test Sheet'!$A$9818,"<="&$C$2,'Test Sheet'!$J$2:'Test Sheet'!$J$9818,A4)

The $ signs are probably important.
 
Upvote 0
Hi ,

I do not know which range you wish to sort , but the first thing to do is to revise your formula so that it reads :

=COUNTIFS('Test Sheet'!$A$2:'Test Sheet'!$A$9818, ">="&$A$2,'Test Sheet'!$A$2:'Test Sheet'!$A$9818,"<="&$C$2,'Test Sheet'!$J$2:'Test Sheet'!$J$9818,A4)

The $ signs are probably important.

Perfect, this fixed my issue, thank you!
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,049
Members
449,206
Latest member
Healthydogs

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