Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Caveman
 
Posts: n/a
Default simplify a vlookup function


I have a vlookup fomula, (the formula below works perfectly but
desperatly needs reducing in the use of IF statements)
=IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+6),"HO L",
IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+7),"HOL ",
IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+8),"HOL ",
IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+9),"HOL ",
IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+10),"HO L",
VLOOKUP(C$2,ALLYEAR!$A$2:$E$366,$J3+1))))))
As i can only use 7 IF statements in a nested formula i need to
simplify the above, so that i can expand the formula in the future with
more if statements if necessary.
The formula searches for peoles names from another worksheet and if
they are listed to be on holiday at a specific date then the result
will show "HOL" against thier name.


--
Caveman
------------------------------------------------------------------------
Caveman's Profile: http://www.excelforum.com/member.php...o&userid=27546
View this thread: http://www.excelforum.com/showthread...hreadid=470746

  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

=IF(COUNTIF(ALLYEAR!$A$2:$A$366,C$2),IF(COUNTIF(OF FSET(ALLYEAR!$A$2,
MATCH(C$2,ALLYEAR!$A$2:$A$366,0)-1,$J3+6,1,5),$B3),"HOL",""),"")




In article ,
Caveman wrote:

I have a vlookup fomula, (the formula below works perfectly but
desperatly needs reducing in the use of IF statements)
=IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+6),"HO L",
IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+7),"HOL ",
IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+8),"HOL ",
IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+9),"HOL ",
IF($B3=VLOOKUP(C$2,ALLYEAR!$A$2:$N$366,$J3+10),"HO L",
VLOOKUP(C$2,ALLYEAR!$A$2:$E$366,$J3+1))))))
As i can only use 7 IF statements in a nested formula i need to
simplify the above, so that i can expand the formula in the future with
more if statements if necessary.
The formula searches for peoles names from another worksheet and if
they are listed to be on holiday at a specific date then the result
will show "HOL" against thier name.

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
Dynamic VLOOKUP function Barb Reinhardt Excel Worksheet Functions 3 August 26th 05 07:36 PM
format cell based on results of vlookup function Edith F Excel Worksheet Functions 1 July 21st 05 07:39 PM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Vlookup w/Date Function cym Excel Worksheet Functions 1 March 25th 05 08:21 PM
Regarding IF function or vLOOKUP function wuwu Excel Worksheet Functions 2 November 13th 04 01:38 PM


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