Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Combining INDIRECT

Hi Group,
I have the following formula used in conditional formatting:

=INDIRECT("I"&ROW())="AB"
=INDIRECT("I"&ROW())="A"
=INDIRECT("I"&ROW())="AC"
=INDIRECT("I"&ROW())="T"

I have 4 different conditions so I have 4 different CF rules. Can they
be combined into one? Thanks in advance for any help!
Ken
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Combining INDIRECT

You can combine these conditions with AND, as in:

=AND(Indirect(...),Indirect(...),Indirect(...),Ind irect(...))

Does this help?

Regards,
Fred.

"Ken" wrote in message
...
Hi Group,
I have the following formula used in conditional formatting:

=INDIRECT("I"&ROW())="AB"
=INDIRECT("I"&ROW())="A"
=INDIRECT("I"&ROW())="AC"
=INDIRECT("I"&ROW())="T"

I have 4 different conditions so I have 4 different CF rules. Can they
be combined into one? Thanks in advance for any help!
Ken


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Combining INDIRECT


Hi Fred,
I tried as you suggested and came up with the following:

=AND(INDIRECT("I"&ROW())="A"),INDIRECT("I"&ROW())= "T"),INDIRECT("I"&ROW
())="AC"),INDIRECT("I"&ROW())="AB"))

It gives me an error message that something is wrong with the
formula....have I missed something?
Thanks for your help!
Ken
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Combining INDIRECT

=AND(INDIRECT("I"&ROW())="A"),INDIRECT("I"&ROW())= "T"),INDIRECT("I"&ROW())="AC"),INDIRECT("I"&ROW()) ="AB"))

Believe it should be an =OR(indirect(1),indirect(2),...) in this instance?
All of the indirects point to the same cell, which can of course only house
a certain value at any one time
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Combining INDIRECT

=OR(INDIRECT("I"&ROW())={"A","T","AC","AB"})

--
__________________________________
HTH

Bob

"Ken" wrote in message
...

Hi Fred,
I tried as you suggested and came up with the following:

=AND(INDIRECT("I"&ROW())="A"),INDIRECT("I"&ROW())= "T"),INDIRECT("I"&ROW
())="AC"),INDIRECT("I"&ROW())="AB"))

It gives me an error message that something is wrong with the
formula....have I missed something?
Thanks for your help!
Ken





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Combining INDIRECT

Thanks to all....
I still get the "formula contains an error" with OR instead of AND,
and Bob's formula gives me "cannot use unions, intersects, or array
constants..." etc. I'm using Excel 2007, if that's a problem. It looks
like either of the formulas should work, but still getting
errors....Thanks for any and all help!
Ken
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Combining INDIRECT

.. get the "formula contains an error" with OR ..

Try it like this, using your xl07 equivalent
for the CF's Formula Is (in xl2003):
=OR(T(INDIRECT("I"&ROW()))="A",T(INDIRECT("I"&ROW( )))="T")

Above tested here, works ok
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Combining INDIRECT

Thanks, Max, that does indeed work! Thank you so much....I can start
eliminating all the extraneous rules....just one question: what is the
T function?? Just wanting to learn!
Ken
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Combining INDIRECT

Actually, think you could make the CF work using the simpler:
=OR($I1="A",$I1="T")
(just ensure that the active cell is on row1 in the CF range selection)

As for T, Excel's Help says:
If value is or refers to text, T(value) returns the value

Assume you have an "A" in I2

Without the T(...)
INDIRECT("I"&ROW()) will return it as an array: {"A"},
which isn't quite the same as "A"

With the T(...)
T(INDIRECT("I"&ROW())) =T({"A"}) ="A",
which returns the correct comparison as TRUE
ie T(INDIRECT("I"&ROW()))="A" is TRUE

--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---
"Ken" wrote in message
...
Thanks, Max, that does indeed work! Thank you so much....I can start
eliminating all the extraneous rules....just one question: what is the
T function?? Just wanting to learn!
Ken



  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 16
Default Combining INDIRECT

Thanks, Max, helps to understand a little bit sometimes....thanks for
all your help, and thanks to all!
Ken


  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Combining INDIRECT

Sorry, I missed the hidden CF bit.

--
__________________________________
HTH

Bob

"Ken" wrote in message
...
Thanks to all....
I still get the "formula contains an error" with OR instead of AND,
and Bob's formula gives me "cannot use unions, intersects, or array
constants..." etc. I'm using Excel 2007, if that's a problem. It looks
like either of the formulas should work, but still getting
errors....Thanks for any and all help!
Ken



  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Combining INDIRECT

Welcome, Ken
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:23,000 Files:370 Subscribers:66
xdemechanik
---
"Ken" wrote in message
...
Thanks, Max, helps to understand a little bit sometimes....thanks for
all your help, and thanks to all!
Ken



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
Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions Mike Barlow Excel Worksheet Functions 7 May 21st 23 07:42 PM
Indirect waldorf Excel Worksheet Functions 5 August 26th 08 08:15 PM
Help with INDIRECT Anita Taylor Excel Worksheet Functions 5 March 6th 08 12:50 AM
INDEX("a"&COLUMNS(INDIRECT(A1):INDIRECT(A2)):A30,4) Dave F[_2_] Excel Discussion (Misc queries) 3 September 20th 07 08:36 PM
Indirect jcastellano Excel Worksheet Functions 5 March 7th 06 06:41 PM


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

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"