View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey Duke Carey is offline
external usenet poster
 
Posts: 1,081
Default vlooup with an if statement?????

With your lookup data in cells L2:N4, and the names to lookup in column A,
the years in row 1, use this array formula (enter it by pressing
Ctrl-Shift-Enter)

=IF(ISERROR(INDEX($N$2:$N$4,MATCH($A2&B$1,$L$2:$L$ 4&$M$2:$M$4,0))),0,INDEX($N$2:$N$4,MATCH($A2&B$1,$ L$2:$L$4&$M$2:$M$4,0)))

"samiauthor" wrote:

Is it possible to do a vlookup with an if statement.
My spreadsheet looks like this:

Name 2003 2004 2005
John "formula" "formula" "formula"


My source looks like this:
Name Year Amount
John 2003 45
John 2005 354
Mary 2004 500

What I need to do is to have the vlookup go down the name list and if the
year equals the header in the top spreadsheet to return the amount.

Is this even possible??????

I need to use this data in a mail merge that MUST go out today.

Any and all suggestions are greatly appreciated and welcome.
Thanks