Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Use of INDIRECT and quotation marks

I'm trying to put together a very simple line formula to give me a SUMPRODUCT
from another worktab. I am entering the formula in the main tab, and I want
it to look at the tab named '2' and tell me how often the word "High" occurs
in column A of tab 2. However, two rows down from this I want my formula to
look in tab '3' to check the same thing in column A. Now I can do this by
using the following formulas:

=IF(A2<"";SUMPRODUCT(--('1'!A:A="High"));"")

=IF(A4<"";SUMPRODUCT(--('2'!A:A="High"));"")

But I don't want to have to change the tab number manually, so I tried to
cook up the following using INDIRECT:

=IF(A2<"";SUMPRODUCT(--(INDIRECT("'"&ROW()/2&"'!A:A="&CHAR(34)&"High"&CHAR(34));"")

This way, the formula would look at the row-number, divide that by 2, check
the corresponding tab for any entries that read "High" and then add those up.
The reason I use CHAR(34) is to get at the quotation marks in ("High")
without breaking the indirect, and I think that's where I fail. Anybody got
any help on this, or on solving the formula in a better way?

Thanks!


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Use of INDIRECT and quotation marks

=IF(A2<"";COUNTIF(INDIRECT("'"&INT(ROW()/2)&"'!A1:A10");"High");"")

--
__________________________________
HTH

Bob

"Babymech" wrote in message
...
I'm trying to put together a very simple line formula to give me a
SUMPRODUCT
from another worktab. I am entering the formula in the main tab, and I
want
it to look at the tab named '2' and tell me how often the word "High"
occurs
in column A of tab 2. However, two rows down from this I want my formula
to
look in tab '3' to check the same thing in column A. Now I can do this by
using the following formulas:

=IF(A2<"";SUMPRODUCT(--('1'!A:A="High"));"")

=IF(A4<"";SUMPRODUCT(--('2'!A:A="High"));"")

But I don't want to have to change the tab number manually, so I tried to
cook up the following using INDIRECT:

=IF(A2<"";SUMPRODUCT(--(INDIRECT("'"&ROW()/2&"'!A:A="&CHAR(34)&"High"&CHAR(34));"")

This way, the formula would look at the row-number, divide that by 2,
check
the corresponding tab for any entries that read "High" and then add those
up.
The reason I use CHAR(34) is to get at the quotation marks in ("High")
without breaking the indirect, and I think that's where I fail. Anybody
got
any help on this, or on solving the formula in a better way?

Thanks!




Reply
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
Quotation Marks 9pluck9 Excel Discussion (Misc queries) 2 May 2nd 07 04:40 PM
Quotation Marks? LinearChaos Excel Worksheet Functions 2 June 25th 06 10:31 PM
without quotation marks? jfazz Excel Discussion (Misc queries) 1 March 2nd 06 04:43 PM
Quotation Marks - When and What?? heski Excel Discussion (Misc queries) 2 February 7th 06 12:40 PM
quotation marks JohnF Excel Worksheet Functions 7 February 5th 06 09:33 PM


All times are GMT +1. The time now is 10:34 AM.

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

About Us

"It's about Microsoft Excel"