View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Greg Wilson Greg Wilson is offline
external usenet poster
 
Posts: 747
Default "LOOKUP" within a condition?

Try:

=IF(V2="Incident", LOOKUP(TODAY()-INT(AK2),{1,4,14,"Over
30"},{"0-7","8-13","15-29","Over 30"}),LOOKUP(TODAY()-INT(AK2),
{1,30,60,90,120},{"0-29","30-59","60-89","90-119","Over 120"}))

Greg

"Leonhardtk" wrote:

I have a LOOKUP that works great (Thanks Biff!!!). Now I need to two
seperate "LOOKUP" commands depeneding on contents of a different field.

My exising LOOKUP, which works:
=LOOKUP(TODAY()-INT(AK2), {1,30,60,90,120},{"0-29","30-59", "60-89",
"90-119","Over 120})

(AK2 is the date the row was created in a database, the earliest date is 15
Sep 06).

I now need to look at the value in "V2" to look for "Incident", if so, my
scale will be different. By when I try my "guess", it doesn't work (figure
that!?). The problem is, while scrolling through the formula, I can't ever
get to the "value if true". Here's my feable attempt:

=IF(V2="Incident", LOOKUP(TODAY()-INT(AK2),{1,4,14,"Over
30"},{"0-7","8-13","15-29","Over 30"},LOOKUP(TODAY()-INT(AK2),
{1,30,60,90,120},{"0-29","30-59", "60-89", "90-119","Over 120})))

Appreciate any assistance,

KSL.