PC Review


Reply
Thread Tools Rate Thread

COUNTA formula with indirect reference - help please!

 
 
Jason Lang
Guest
Posts: n/a
 
      4th Mar 2008
Hi--

I am getting strange results with a formula. I would like to use
COUNTA to count non blanks in a worksheet called "Data". I'd like it
to take column values from cells C2 and D2 to get the range of data in
"Data" to count. What I have is:

=COUNTA("Data!"&$C$2&ROW()&"ata!"&$D$2&ROW())

However, this always returns 1 regardless of the number of blanks.

I think my problem is related to the following. Just playing around,
I tried a direct formula to count nonblanks in columns AE:AJ:

=COUNTA(Data!AE3ata!AJ3) --- Works correctly
=COUNTA("Data!AE3ata!AJ3") --- always returns 1 like my example
above

Any suggestions for how to get the first formula to work correctly?

Thanks!
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      4th Mar 2008
Maybe...
=COUNTA(INDIRECT("Data!"&$C$2&ROW()&":"&$D$2&ROW()))

Your formula which boils down to this:
=COUNTA("Data!AE3ata!AJ3")

Is counting how many things are inside those (). In this case you have a single
string, so you get 1.

=counta("a","b")
would return 2

=COUNTA(Data!AE3ata!AJ3)
More often written like:
=COUNTA(Data!AE3:AJ3)
will count the non-empty cells in AE3:AJ3 of the Data worksheet.



Jason Lang wrote:
>
> Hi--
>
> I am getting strange results with a formula. I would like to use
> COUNTA to count non blanks in a worksheet called "Data". I'd like it
> to take column values from cells C2 and D2 to get the range of data in
> "Data" to count. What I have is:
>
> =COUNTA("Data!"&$C$2&ROW()&"ata!"&$D$2&ROW())
>
> However, this always returns 1 regardless of the number of blanks.
>
> I think my problem is related to the following. Just playing around,
> I tried a direct formula to count nonblanks in columns AE:AJ:
>
> =COUNTA(Data!AE3ata!AJ3) --- Works correctly
> =COUNTA("Data!AE3ata!AJ3") --- always returns 1 like my example
> above
>
> Any suggestions for how to get the first formula to work correctly?
>
> Thanks!


--

Dave Peterson
 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      4th Mar 2008
You can build up a cell or range address as a string (as you are
trying to do), but you must use the INDIRECT function to get Excel to
recognise it. Try this:

=COUNTA(INDIRECT("Data!"&$C$2&ROW()&"ata!"&$D$2&ROW()))

Hope this helps.

Pete

On Mar 4, 10:00*pm, Jason Lang <jal...@uchc.edu> wrote:
> Hi--
>
> I am getting strange results with a formula. I would like to use
> COUNTA to count non blanks in a worksheet called "Data". *I'd like it
> to take column values from cells C2 and D2 to get the range of data in
> "Data" to count. *What I have is:
>
> =COUNTA("Data!"&$C$2&ROW()&"ata!"&$D$2&ROW())
>
> However, this always returns 1 regardless of the number of blanks.
>
> I think my problem is related to the following. *Just playing around,
> I tried a direct formula to count nonblanks in columns AE:AJ:
>
> =COUNTA(Data!AE3ata!AJ3) * --- Works correctly
> =COUNTA("Data!AE3ata!AJ3") --- always returns 1 like my example
> above
>
> Any suggestions for how to get the first formula to work correctly?
>
> Thanks!


 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      4th Mar 2008
Try it like this:

=COUNTA(INDIRECT("Data!"&$C$2&ROW()&":"&$D$2&ROW()))


--
Biff
Microsoft Excel MVP


"Jason Lang" <(E-Mail Removed)> wrote in message
news:fd4162f0-7622-4d5b-853c-(E-Mail Removed)...
> Hi--
>
> I am getting strange results with a formula. I would like to use
> COUNTA to count non blanks in a worksheet called "Data". I'd like it
> to take column values from cells C2 and D2 to get the range of data in
> "Data" to count. What I have is:
>
> =COUNTA("Data!"&$C$2&ROW()&"ata!"&$D$2&ROW())
>
> However, this always returns 1 regardless of the number of blanks.
>
> I think my problem is related to the following. Just playing around,
> I tried a direct formula to count nonblanks in columns AE:AJ:
>
> =COUNTA(Data!AE3ata!AJ3) --- Works correctly
> =COUNTA("Data!AE3ata!AJ3") --- always returns 1 like my example
> above
>
> Any suggestions for how to get the first formula to work correctly?
>
> Thanks!



 
Reply With Quote
 
Jason Lang
Guest
Posts: n/a
 
      5th Mar 2008
Hi all--
Thanks so much for the replies. Unfortunately, all of these formulas
continue to give me the value of "1" when I put them in my
spreadsheet. Any other ideas?

Jason
 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      5th Mar 2008
See this screencap:

http://img142.imageshack.us/img142/6184/indirectej3.jpg

The formula does work. I just used it on the same sheet so that you can see
it does return the correct results.


--
Biff
Microsoft Excel MVP


"Jason Lang" <(E-Mail Removed)> wrote in message
news:458599ed-cf72-4692-97dd-(E-Mail Removed)...
> Hi all--
> Thanks so much for the replies. Unfortunately, all of these formulas
> continue to give me the value of "1" when I put them in my
> spreadsheet. Any other ideas?
>
> Jason



 
Reply With Quote
 
Jason Lang
Guest
Posts: n/a
 
      5th Mar 2008
You are right...I am not sure what I did wrong before. Thanks!!

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      5th Mar 2008
Getting all of those "stupid" quotes in the correct order can be a challenge
sometimes! That's what usually trips people up.

Thanks for feeding back!

--
Biff
Microsoft Excel MVP


"Jason Lang" <(E-Mail Removed)> wrote in message
news:9c164100-9943-4cc6-899a-(E-Mail Removed)...
> You are right...I am not sure what I did wrong before. Thanks!!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array Formula + Indirect Reference davey11372 Microsoft Excel Worksheet Functions 0 15th Dec 2009 03:52 AM
Cell color index formula reference instead of =counta Mr. m0le Microsoft Excel Misc 0 30th Jul 2009 02:13 AM
Can INDIRECT function reference a cell that contains a formula =?Utf-8?B?U3RldmUgRQ==?= Microsoft Excel Worksheet Functions 14 23rd Aug 2006 10:49 PM
indirect reference to a formula? mark kubicki Microsoft Excel Programming 3 10th May 2006 05:24 PM
Help with an Indirect formula to reference sheet names PCLIVE Microsoft Excel Programming 4 4th Aug 2005 05:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:38 PM.