![]() |
![]() |
|
|||||||
| Lounge v.2.0 A place to chat. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Join Date: Jun 2008
Location: North Carolina
Posts: 2,378
|
a (to me) more traditional equation would be
=INDIRECT("E"&SUMPRODUCT(NOT(ISERR(FIND($D$2:$D$10,A2)))*ROW($D$2:$D$10))) an alternate would be to name the "color" range and when new colors were added, just change the named range =INDIRECT("E"&SUMPRODUCT(NOT(ISERR(FIND(color,A2)))*ROW(color))) with color defined as d2:d10 |
|
|
|
|
|
#2 |
|
Join Date: Jun 2008
Posts: 0
|
My idea was this for B2 and down (CSE, of course):
=OFFSET(D$1,SUM((IFERROR(FIND(D$1:D$10,A2),0)>0)*ROW(D$1:D$10))-1,1) While that may not get me the win again this year since Harry Houdini's is a slicker approach, his can be improved upon. This is shorter by a few characters and works well: =LOOKUP(2^9,FIND(D$2:D$10,A2),E$2:E$10) Great job Harry. Last edited by Daniel Ferry; Jun 21st, 2008 at 05:37 AM. |
|
|
|
|
|
#3 |
|
Join Date: Jun 2008
Posts: 0
|
I meant this for Harry's formula:
=LOOKUP(9^6,FIND(D$2:D$10,A2),E$2:E$10) which will work for all of the rows in 2007, and earlier versions. From a character count perspective, I do not think it's possible to improve this and still maintain the ability to copy the formula down. |
|
|
|
|
|
#4 |
|
Join Date: Jun 2008
Posts: 0
|
By the way, 9^5 is sufficient (in Harry's approach) since the limit to the number of characters in a cell is now 32,000 in Excel 2007. The limit was just 1,000 characters in prior versions. These alarmingly large numbers are overkill: the "color" could at most be 32,000 characters into the string in a cell, so 9^4 is too small to account for the "ultimate" case, while 9^5 is overkill but will work in any situation, without exception.
|
|
|
|
|
|
#5 | |
|
MrExcel MVP
Moderator Contortionist Join Date: Apr 2005
Location: Hampshire, UK (Home); London, UK (Work)
Posts: 18,308
|
Quote:
__________________
Richard Schollar Microsoft MVP - Excel Need to post some data? PM me with your email address for the Beta version of the Board html maker! |
|
|
|
|
|
|
#6 |
|
Join Date: Jun 2008
Location: North Carolina
Posts: 2,378
|
9^5 is greater than 2^15 with fewer characters.
![]() Is there any penalty, Time, processing, etc., for using a number greater than is needed? similarly, is there any penalty, for using a number raised to a power vs using the written out number? also, is there any penalty, for using a named constant rather than having the value in the formula I have been bit by Excel's floating decimal method before. |
|
|
|
|
|
#7 |
|
Join Date: Jun 2008
Posts: 0
|
Richard:
I was referring to the number of characters that can be printed from a cell. The new limit is 32k; the old is 1k. This comes from the Excel Team Blog at MSDN: http://blogs.msdn.com/excel/archive/...26/474258.aspx At any rate, 9^5 works in all cases and is the most compact method possible. It is also slightly faster than 2^15 (less multiplications going on). But that takes us in a different direction. I have been arguing for compactness of formula. The QUICKEST formula would replace all of these large numbers generators with the constant: 32767 |
|
|
|
|
|
#8 | |
|
Join Date: Jun 2008
Location: North Carolina
Posts: 2,378
|
Quote:
charactercount is reduced by =LOOKUP(x,FIND(c,A2),n) Last edited by wsjackman; Jun 21st, 2008 at 01:47 PM. |
|
|
|
|
|
|
#9 |
|
Join Date: Jun 2008
Location: North Carolina
Posts: 2,378
|
typical typos for me
c needs to be cc, n needs to be nn, x needs to be xx |
|
|
|
|
|
#10 | |
|
Join Date: Jun 2008
Posts: 0
|
Quote:
Obviously my post meant that my improvement on Houdini's formula was the shortest character count possible WITHOUT resorting to named formulas. One could simpy name any of the formulas that work, "zz". Now all you need to enter is: =zz But that's pointless. My improvement still reigns as the SHORTEST character count possible WITHOUT named formulas. HOWEVER, dynamic ranges would be an improvement usability-wise, for the lookup tables... Last edited by Daniel Ferry; Jun 21st, 2008 at 07:37 PM. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|