LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default If Function with Multiple Conditions


Using Lookup I want to return a value to a cell based upon 2 conditions,
which can exist in any one of four combinations:
YY
YN
NY
YN

The first letter determines which of two Lookup tables are used (Lookup
High or Lookup Std) the second determines which column in the relevant
Lookup table to use for the value to be returned.

I have the two following expressions each of which returns a correct
value but only if the first letter condition is correct (Y or N).

=IF($F2="YN",((INDEX('Lookup High'!$C$2:$D$45,MATCH(AM2,'Lookup
High'!$C$2:$C$45,),MATCH(BM$1,'Lookup
High'!$C$2:$D$2,)))),IF($F2="YY",(INDEX('Lookup
High'!$E$2:$F$45,MATCH(AM2,'Lookup
High'!$E$2:$E$45,),MATCH(BM$1,'Lookup High'!$E$2:$F$2,)))))

=IF($F2="NN",((INDEX('Lookup STD'!$C$2:$D$45,MATCH(AM2,'Lookup
STD'!$C$2:$C$45,),MATCH(BM$1,'Lookup
STD'!$C$2:$D$2,)))),IF($F2="NY",(INDEX('Lookup
STD'!$E$2:$F$45,MATCH(AM2,'Lookup STD'!$E$2:$E$45,),MATCH(BM$1,'Lookup
STD'!$E$2:$F$2,)))))

When I combine these:

=IF($F2="YN",((INDEX('Lookup High'!$C$2:$D$45,MATCH(AM2,'Lookup
High'!$C$2:$C$45,),MATCH(BM$1,'Lookup
High'!$C$2:$D$2,)))),IF($F2="YY",(INDEX('Lookup
High'!$E$2:$F$45,MATCH(AM2,'Lookup
High'!$E$2:$E$45,),MATCH(BM$1,'Lookup
High'!$E$2:$F$2,))))),IF($F2="NN",((INDEX('Lookup
STD'!$C$2:$D$45,MATCH(AM2,'Lookup STD'!$C$2:$C$45,),MATCH(BM$1,'Lookup
STD'!$C$2:$D$2,)))),IF($F2="NY",(INDEX('Lookup
STD'!$E$2:$F$45,MATCH(AM2,'Lookup STD'!$E$2:$E$45,),MATCH(BM$1,'Lookup
STD'!$E$2:$F$2,)))))

Excel gives the result #VALUE!

Any help in spotting the error would be appreciated.

I would also like to return the value 0 if none of the conditions are
met.

Thanks in advance
Tlosgyl3



--
tlosgyl3
------------------------------------------------------------------------
tlosgyl3's Profile: http://www.excelforum.com/member.php...o&userid=28074
View this thread: http://www.excelforum.com/showthread...hreadid=559277

 
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
Use IF function for two conditions wuwu Excel Worksheet Functions 3 April 29th 23 11:42 AM
Logiacl function with multiple conditions stellarblue11 Excel Worksheet Functions 4 May 25th 06 03:55 PM
COUNTIF - multiple conditions allphin Excel Worksheet Functions 4 September 18th 05 04:05 PM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM
Vlookup with multiple conditions cambrus Excel Worksheet Functions 1 March 11th 05 05:21 PM


All times are GMT +1. The time now is 11:44 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"