DotDragnet
May 24, 2012, 05:31:44 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: follow us on twitter @dotdragnet
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Shorten this Excel Fomula?  (Read 255 times)
slaughteredlamb
DDN Contributor
Hero Member
*****
Posts: 1089



peakoverload
View Profile WWW Awards
« on: July 15, 2011, 02:38:02 PM »

This is my current formula I'm using in an Excel spreadsheet that we use as our staff rota:

=IF(Checking!E13<3,"",CONCATENATE(VLOOKUP(Checking!E13,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E14,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E15,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E16,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E17,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E18,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E19,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E20,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E21,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E22,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E23,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E24,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E25,Staff!A20:C33,2,FALSE)))

However I now need to add three new members of staff which means amending this code to:

=IF(Checking!E13<3,"",CONCATENATE(VLOOKUP(Checking!E13,Staff!A20:B33,2,FALSE)," ",VLOOKUP(Checking!E14,Staff!A20:B33,2,FALSE)," ",VLOOKUP(Checking!E15,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E16,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E17,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E18,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E19,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E20,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E21,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E22,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E23,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E24,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E25,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E26,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E27,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E28,Staff!A20:C33,2,FALSE)))

However when I do this I get a message saying that I'm using too many arguments for this function.

Is there a way of perform the same function but in a shorter way?
Logged
Whatever
Hero Member
*****
Posts: 750



View Profile WWW Awards
« Reply #1 on: July 16, 2011, 08:50:10 AM »

IIRC it's 7 arguments in an IF/ELSE statement but I'm afraid I wouldn't know how to shorten it sorry.
Logged

Office Stationery : Paper : Inks & Toners
10% off first 3 orders for registered users. Use the code DDN10
JasonD
Global Moderator
Hero Member
*****
Posts: 551



View Profile Awards
« Reply #2 on: July 16, 2011, 12:41:43 PM »

There are only 3 arguments to the IF. I'd guess VLOOKUP(...) & " " & VLOOKUP... Instead of CONCATENATE().
Logged
Whatever
Hero Member
*****
Posts: 750



View Profile WWW Awards
« Reply #3 on: July 17, 2011, 08:22:07 AM »

This is my current formula I'm using in an Excel spreadsheet that we use as our staff rota:

=IF(Checking!E13<3,"",CONCATENATE(VLOOKUP(Checking!E13,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E14,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E15,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E16,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E17,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E18,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E19,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E20,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E21,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E22,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E23,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E24,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E25,Staff!A20:C33,2,FALSE)))

However I now need to add three new members of staff which means amending this code to:

=IF(Checking!E13<3,"",CONCATENATE(VLOOKUP(Checking!E13,Staff!A20:B33,2,FALSE)," ",VLOOKUP(Checking!E14,Staff!A20:B33,2,FALSE)," ",VLOOKUP(Checking!E15,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E16,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E17,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E18,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E19,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E20,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E21,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E22,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E23,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E24,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E25,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E26,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E27,Staff!A20:C33,2,FALSE)," ",VLOOKUP(Checking!E28,Staff!A20:C33,2,FALSE)))

However when I do this I get a message saying that I'm using too many arguments for this function.

Is there a way of perform the same function but in a shorter way?

Just a thought and not tried it but would the following not work?

=IF(Checking!E13:E28,Staff!A20:B33,2,FALSE)
Logged

Office Stationery : Paper : Inks & Toners
10% off first 3 orders for registered users. Use the code DDN10
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!