View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John C[_2_] John C[_2_] is offline
external usenet poster
 
Posts: 1,358
Default VLOOKUP with IF logic

You could just include the formatting with it, like so:
=TEXT(IF(ISNA(VLOOKUP(B2,Sheet1!$C$2:$F$154,4,FALS E)),"No Project
Found",VLOOKUP(B2,Sheet1!$C$2:$F$154,4,FALSE)),"MM/DD/YY HH:MM AM/PM")
--
** John C **
Please remember if your question is answered, to mark it answered :). It
helps everyone.


"Rae" wrote:

Thank you John, your example worked.
I just have to remember to change the cell format to date when it returns a
date instead of text.

Rae

"John C" wrote:

I believe this will match what you need.

=IF(ISNA(VLOOKUP(B2,Sheet1!$C$2:$F$154,5,FALSE))," No Project
Found",VLOOKUP(B2,Sheet1!$C$2:$F$154,5,FALSE))
--
** John C **

"Rae" wrote:

How do you write the following IF statement using vlookup functionality? Can
I use vlookup function imbedded in an IF statement for this scenario or is
there another function to use?

Look for project number in another worksheet (tab) (within the same
workbook), if project is found (true) return the open date. Else if not
found return the comment "no project found". Open date is stored/defined as
<date,time.

I think the IF statement with vlookup would be written in this manner but
it's not working for me.

=IF(VLOOKUP,B2,Sheet1!C2:C154,1,false),Sheet1!F2:F 154,"no project found")

b2 = project number that vlookup is searching for on worksheet 1, range
c2:c154
sheet1!f2:f154 = is where the open date would be found if the project is
found on worksheet 1.


Thanks,
Rae