+ Reply to Thread
Results 1 to 6 of 6

Ignore "-" in lookup formula

  1. #1
    Registered User
    Join Date
    04-11-2020
    Location
    Portland, OR
    MS-Off Ver
    O365
    Posts
    8

    Ignore "-" in lookup formula

    I am using a lookup formula =lookup(2,1/(hbo!$b34:$h34>0),hbo!$34:$h34) in a summary report to find the current days sales data.

    Is there a way to add an additional criteria to this lookup formula to ignore cells with "-" in them? The worksheet my formula is referencing has lot of these (blank cells are filled with "-" because of the formula populating this worksheet) so my lookup formula returns "-" when it finds them instead of the last value in the row it is searching.

    Thank you.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,288

    Re: Ignore "-" in lookup formula

    Welcome to the forum.

    Try this:

    =LOOKUP(2,1/((hbo!$b34:$h34>0)*(hbo!$b34:$h34<>"-")),hbo!$34:$h34)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-11-2020
    Location
    Portland, OR
    MS-Off Ver
    O365
    Posts
    8

    Re: Ignore "-" in lookup formula

    Yes, that works. Although it doesn't like negative numbers. I don't either but I need to show them.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,288

    Re: Ignore "-" in lookup formula

    Well, that’s not my fault! You already had the formula looking for matches that are bigger than 0.

  5. #5
    Registered User
    Join Date
    04-11-2020
    Location
    Portland, OR
    MS-Off Ver
    O365
    Posts
    8

    Re: Ignore "-" in lookup formula

    Ooops! Right you are. Insert embarrassed emoji here.

    Thank you for your help and prompt responses.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,288

    Re: Ignore "-" in lookup formula

    No worries!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Replies: 3
    Last Post: 10-22-2019, 08:34 AM
  2. [SOLVED] Pivot Table / Chart Ignore / Exclude blank "" cells created using IF formula
    By randomreflex in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 05-23-2018, 08:59 AM
  3. Help with lookup formula to return "Available" or "Unavailable" based on last entry
    By AntonyCole1979 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-07-2017, 05:14 PM
  4. [SOLVED] Help with lookup formula to return "Available" or "Unavailable" based on last entry
    By AntonyCole1979 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-07-2017, 12:28 PM
  5. Data Validation - how to ignore cells with "0" or "-"
    By dgibney in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-29-2015, 08:16 PM
  6. [SOLVED] array formula count "number of" - can it ignore blanks
    By nigelog in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-24-2014, 09:33 AM
  7. [SOLVED] Counting data only contains text (ignore mark "-" & "")
    By Jhon Mustofa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-12-2014, 09:45 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