View Single Post
 
Old 06-01-2011, 01:57 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Sure,

If you put the list of colours, say red, blue and orange into cells J1:J3, two options would be:

(1) Use the same formula as above, but with the array constant replaced by the range and enter it as an array formula. To do this, when you type the formula into the formula bar, finish the entry with CTRL+SHIFT+ENTER instead of just ENTER. If done correctly then Excel will automatically surround the formula with braces { } (you can't manually enter these yourself).
Code:
{=IF(OR(ISNUMBER(SEARCH(J1:J3,A1))),B1,0)}
(2)
Use a variation such as this one (which can be entered as a normal formula).
Code:
=IF(SUMPRODUCT(--ISNUMBER(SEARCH(J1:J3,A1))),B1,0)
Reply With Quote