LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default COUNTIF Query

I have a standard COUNTIF query in a spreadsheet that I'm adding a macro to
in order to automate its generation.

At present the formula is =COUNTIF('Original Data'!Y:Y,B3) and it returns a
value of 595, which is correct.

I have some code in my macro which returns the column number (25) according
to set criteria and inserts this into the above formula. I have to determine
the column number each time as some enlightened people keep messing with the
source data format and columns move about in their exports (don't ask!).

So, the revised formula looks like this: =COUNTIF('Original Data'!25:25, B3)
and returns a value of 8. A very incorrect number!

Why does this happen and what's the best way to ensure that I get the
correct result returned? I have about 600 of these formulae to set up for
various parts of the spreadsheet. If I knew that the source data layout was
going to be static, I wouldn't be bothering with a macro at all and would
just leave all the formulae in situ.

Many thanks
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif query Keith[_3_] Excel Worksheet Functions 2 February 16th 10 01:43 AM
COUNTIF function query Wendy-Bob[_2_] Excel Worksheet Functions 6 January 21st 09 03:05 PM
COUNTIF Query Jack Excel Programming 8 July 11th 07 03:50 AM
Countif Query John Moore Excel Discussion (Misc queries) 4 June 25th 07 10:06 PM
CountIf function query Alan M Excel Programming 2 March 27th 06 02:52 PM


All times are GMT +1. The time now is 09:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"