+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    01-20-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    If statements and v look up

    Hi

    I have the following formula -

    =IF(A12=1,(VLOOKUP(B12,'O2 Offlline'!$A:$N,7,0)),(VLOOKUP(B12,'All Offline'!$A:$N,7,0)))

    which is a formula to perform a v look on cell B based on whether Cell A is equal to 1 or 2. However the problem with this is that it will return #N/A if it can't find any data for cell B which is a problem when it's totaling at the bottom.

    However using this formula

    =IF(ISNA(VLOOKUP($B12,'O2 Offlline'!$A:$N,7,FALSE)),0,VLOOKUP($B12,'O2 Offlline'!$A:$N,7,FALSE))

    on just one sheet will return a - if it can't find the data and therefore doesn't effect the total as it's counted as a zero. Now that's not helpful as I need it to perform the vlook-up based on the 2 sheets but for it also to return a - if it can't find any data... any ides on how to combine the 2 formulas to create a vlook-up on 2 sheets but it return any data that it can't find as a -

    Thanks
    Last edited by Xpio; 02-25-2010 at 06:49 AM.

  2. #2
    Registered User
    Join Date
    01-20-2010
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: If statements and v look up

    Ah sorted it, thanks for anyone's time who looked at it.

    =IF(A13=1,(IF(ISNA(VLOOKUP($B13,'O2 Offlline'!$A:$N,7,FALSE)),0,VLOOKUP($B13,'O2 Offlline'!$A:$N,7,FALSE))),(IF(ISNA(VLOOKUP($B13,'All Offline'!$A:$N,7,FALSE)),0,VLOOKUP($B13,'All Offline'!$A:$N,7,FALSE))))

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0