IF(COUNTA(OFFSET formula arror

Chunky_22

Board Regular
Joined
May 19, 2004
Messages
149
Hi guys

This may be too hard to explain here, but I'll give it a go. My sheet is too large and complicated to post. And it was built by someone else, I dont fully understand it.

Cell B3 is a named range - 'CurrMthCellCount". It contains a formula:
=MATCH(CurrentDate,5:5,0)

CurrentDate is selcted by the user.

Row 5 is a date range, from 01/05/2007 in E5 all the way to 01/07/2011 in BC5. There is data under this down to row 77, with headers down column A


There is another formula in B4, and this is the one with the error:
=IF(COUNTA(OFFSET(A6:A77,0,CurrentMonthColumn-1))=0,"FALSE","TRUE")

This formula works fine until the user selects 01/06/2010 or later. 01/05/2011 or earlier returns a TRUE result. 01/06/2011 or later returns a FALSE result.

This FALSE result prevents some macros from running.

Any ideas?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Sounds to me like whoever built this, did it as a safety measure. It's a simple check to see if there are any cells with data below the header that matches the selected date. My guess is that the macro will either error or not need to be run if there is no data below the matching date, hence the check. My suggestion would be to investigate further.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

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