+ Reply to Thread
Results 1 to 2 of 2

How to skip blank cells and use formula

  1. #1
    Registered User
    Join Date
    06-30-2014
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    3

    How to skip blank cells and use formula

    I am trying to figure out how to have my formula work even though there is a blank cell in some of rows on my table.

    Right now I have a vlookup table that looks like this.

    Reference Output
    Grape Fruit
    Orange Fruit
    Celery Vegetable
    Lettuce Vegetable
    Bread Other
    Eggs Other

    I am using this Vlookup table to run the output for the table below


    Item 1 Item 2 Output
    Grape Celery Fruit
    Grape Eggs Fruit
    Celery Eggs Vegetable
    Orange Fruit


    The formula that is pulling these results is =IF(OR(VLOOKUP(G7,$A$3:$B$9,2,FALSE)="Fruit",VLOOKUP(H7,$A$3:$B$9,2,FALSE)="Fruit"),"Fruit",IF(OR(VLOOKUP(G7,$A$3:$B$9,2,FALSE)="Vegetable",VLOOKUP(H7,$A$3:$B$9,2,FALSE)="Vegetable"),"Vegetable","Other"))

    My goal was for the output to identify items in an hierarchy with it firstly identifying fruits, then vegetables and everything else as other. However, in the case where the "Item" column is blank, the output results in #N/A.

    What can I do for my formula so that it ignores the blank cell and runs the formula anyway. In this case, in row 4 for it to display "fruit" even though there is a blank item.

    Any help with formulas or macros would be much appreciated!!

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to skip blank cells and use formula

    just put a vlookup around the whole formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    also provide a worksheet next time
    makes it easier for people to answer

    also included an alternative way of righting the formula
    which is based on the order of your reference table
    fruit>vegetable>other

    this will help you grow if you have more categories
    fruit>vegetable>other>fish>meat>etc

    as long as your table is sorted in the order you want for preferences
    Attached Files Attached Files
    Last edited by humdingaling; 07-16-2014 at 09:07 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. A Formula to skip blank cells (array?)
    By nemo74 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-16-2013, 12:44 PM
  2. How to Skip blank cells SEE PIC
    By zit1343 in forum Excel General
    Replies: 13
    Last Post: 04-12-2012, 05:43 PM
  3. Replies: 4
    Last Post: 04-09-2012, 12:06 PM
  4. Skip Blank Cells
    By belly0fdesire in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-08-2006, 02:21 AM
  5. I want to copy a formula n Excel but skip any blank cells
    By Ann in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-12-2005, 03:00 PM

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.6.0 RC 1