LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default 7+ Nested if Statement using indirect function

"Elkar" wrote...
....
=IF(OR($E12={"","(Show All)","(All)"}),
IF(ISERROR(CELL("address",INDIRECT("'"&F12&"'!j7" ))),"",
INDIRECT("'"&F12&"'!j7")),"")&IF($E12="Base",
IF(ISERROR(CELL("address",INDIRECT("'"&F12&"'!j8" ))),"",
INDIRECT("'"&F12&"'!j8")),"")&IF($E12="Investme nt Projects",
IF(ISERROR(CELL("address",INDIRECT("'"&F12&"'!j9" ))),"",
INDIRECT("'"&F12&"'!j9")),"")&IF($E12="Corporate" ,
IF(ISERROR(CELL("address",INDIRECT("'"&F12&"'!j10 "))),"",
INDIRECT("'"&F12&"'!j10")),"")&IF($E12="Inter-Branch Charging",
IF(ISERROR(CELL("address",INDIRECT("'"&F12&"'!j11 "))),"",
INDIRECT("'"&F12&"'!j11")),"")&IF($E12="CBSA",
IF(ISERROR(CELL("address",INDIRECT("'"&F12&"'!j12 "))),"",
INDIRECT("'"&F12&"'!j12")),"")&IF(AND($E12<{""," (Show All)","(All)",
"Base","Investment Projects","Corporate","Inter-Branch Charging","CBSA"}),
IF(ISERROR(CELL("address",INDIRECT("'"&F12&"'!j13 "))),"",
INDIRECT("'"&F12&"'!j13")),"")

Instead of nesting the formulas inside one another, I just concatenated
several IFs together. Since its impossible for more than one of them to
be TRUE at the same time, this method works.


Better to use some lookups. And it's not necessary to check the precise cell
reference, just check that F12 points to a worksheet in some open workbook.

=IF(ISERROR(CELL("Address",INDIRECT("'"&F12&"'!J1" ))),"",
IF(OR(COUNTIF($E12,{"","(All)","(Show All)","Base","CBSA","Corporate",
"Inter-Branch Charging","Investment Projects"})),INDIRECT("'"&F12&"'!J"&
LOOKUP($E12,{"","(All)","(Show All)","Base","CBSA","Corporate",
"Inter-Branch Charging","Investment Projects"},7,7,7,8,12,10,11,9})),
INDIRECT("'"&F12&"'!J13")))


 
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
IF STATEMENT - NESTED tojo107 Excel Worksheet Functions 4 April 19th 07 08:14 PM
Why doesn't the INDIRECT function work when nested in FREQUENCY? Philip J Smith Excel Worksheet Functions 10 February 26th 07 06:54 PM
Fill an Indirect Statement D Excel Discussion (Misc queries) 4 November 20th 06 07:21 PM
nested Indirect to other WS LyleF Excel Worksheet Functions 4 August 3rd 05 04:11 PM
Combining SUM Function with Nested If Statement Somecallmejosh Excel Discussion (Misc queries) 3 December 6th 04 04:25 PM


All times are GMT +1. The time now is 01:20 AM.

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"