+ Reply to Thread
Results 1 to 17 of 17

2016 excel: Skip & ignore empty cells in formula

  1. #1
    Registered User
    Join Date
    07-18-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    84

    2016 excel: Skip & ignore empty cells in formula

    The formula i am using in question is:

    =IF(ISNA(MATCH(F16,[FRI.xlsx]Who_Did_What!$C:$C,0)),"",VLOOKUP(F16,[FRI.xlsx]Who_Did_What!$C:$D,2,FALSE))

    This is in multiple cells. There is one cell that does not work because the column it is looking at in "[FRI.xlsx]Who_Did_What!$C:$C" has empty cells.

    Therefore the cell which has this formula returns "0".

    I want the formula to skip/ignore the blank cells and resume the calculation.

    The solution needs to be in the formula, or some macro. This is because the sheet with the empty cell "FRI.XLSX" is exported from another piece of software. Also the users of this workbook (where the formula is) are basic excel users and will not have the time to modify MON.XLSX, TUE.XLSX, WED.XLSX and so on.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: 2016 excel: Skip & ignore empty cells in formula

    The fact that you are looking up another workbook is irrelevant. I can't understand what your issue is... Can you take a look at this sheet and try to reproduce your problem. I have changed the formula, BtW...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    07-18-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    84

    Re: 2016 excel: Skip & ignore empty cells in formula

    Hi Thanks for your reply!

    I THINK i reattached your spreadsheet with an extra tab (WHO_DID_WHAT), which closely looks like the "FRI.XLSX" i was referring to.

    I'm trying to get I16 to find the value that is in F16 in the "WHO_DID_WHAT" sheet, and return the corresponding value in column D.

    As you can see i put in gaps and other strange characters this report gives me, this is just like what i am actually working with.

    (original i can't attach for data protection reasons)
    Attached Files Attached Files

  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
    80,719

    Re: 2016 excel: Skip & ignore empty cells in formula

    What is your expected result in that yellow cell?
    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.

  5. #5
    Registered User
    Join Date
    07-18-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    84

    Re: 2016 excel: Skip & ignore empty cells in formula

    Hi,

    742, next to "TOD", column D, WHO_DID_WHAT sheet

  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
    80,719

    Re: 2016 excel: Skip & ignore empty cells in formula

    Well, you are not matching like for like, so it will never work.

    Try this:

    =IFERROR(VLOOKUP(VALUE(RIGHT(F16,2)),Sheet2!$C:$D,2,FALSE),"")

    Is that any closer?

  7. #7
    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
    80,719

    Re: 2016 excel: Skip & ignore empty cells in formula

    Quote Originally Posted by ZMAFC94 View Post
    Hi,

    742, next to "TOD", column D, WHO_DID_WHAT sheet

    OK - I'll have another look.

    This:

    =IFERROR(VLOOKUP(F16,WHO_DID_WHAT!$C$1:$D$20,2,FALSE),"")

  8. #8
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: 2016 excel: Skip & ignore empty cells in formula

    Glenn's formula works: =IFERROR(VLOOKUP(F16,WHO_DID_WHAT!$C:$D,2,FALSE),"")
    Since you are looking for numbers and if your expected result is not returned, convert the IDs to actual numbers. You can also check for extra spaces or non-breaking ones.
    Click the * to say thanks.

  9. #9
    Registered User
    Join Date
    07-18-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    84

    Re: 2016 excel: Skip & ignore empty cells in formula

    Hello

    Thanks for all your solutions

    I've tried this on my sheet and it returns 0

    If this helps:
    I had a search for the value that the formula is looking up, manually, using CTRL+F.
    I looked at the first few cells that contain this value, in column C, and D is the column that has empty values.
    So i'm guessing if the cell in column D is empty, this is why its returning a '0'

    Can i add something to the formula to ignore the empty cells in D? Because it is FINDING things in C but RETURNING empty cells in D.


    Thanks so much

  10. #10
    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
    80,719

    Re: 2016 excel: Skip & ignore empty cells in formula

    What did you try? My solution?

    If it returns 0, then it's finding a match, but maybe the wrong column or row. Remember you will need to adjust the formula for your real data. Without seeing the real data, it's really hard to help - it's just guesswork.

  11. #11
    Registered User
    Join Date
    07-18-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    84

    Re: 2016 excel: Skip & ignore empty cells in formula

    I tried your solution,

    The example workbook i uploaded uses exactly the same cell numbers and sheet names as the original, so that i can replicate. I've just amended the example sheet to replicate the empty cells in the D column & now it's returning 0 like the original,

    So now we have an example just like the original we can look at (see attached).
    Attached Files Attached Files

  12. #12
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: 2016 excel: Skip & ignore empty cells in formula

    Your explanation was misleading. Basically, you've wanted the first match that is not blank based on your criteria. The VLOOKUP returned 0 because it found the first match, but that one was empty. Try this:
    =INDEX(WHO_DID_WHAT!$D$1:$D$20,MATCH(1,($F16 = WHO_DID_WHAT!$C$2:$C$20)*(WHO_DID_WHAT!$D$1:$D$20<>""),0))
    It is an array formula, meaning that you need to use Ctrl+Shift+Enter instead of regular Enter

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: 2016 excel: Skip & ignore empty cells in formula

    Withdrawn by GK. Wrong answer.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: 2016 excel: Skip & ignore empty cells in formula

    A variant of Paul's...

    a non-array formula:

    =INDEX(WHO_DID_WHAT!$D$1:$D$20,MATCH(1,INDEX(($F16 = WHO_DID_WHAT!$C$2:$C$20)*(WHO_DID_WHAT!$D$1:$D$20<>""),0),0))

  15. #15
    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
    80,719

    Re: 2016 excel: Skip & ignore empty cells in formula

    Quote Originally Posted by PaulM100 View Post
    Your explanation was misleading.
    Yes, it was, really - however, had the sample data been a better representation of the real data in the first place, it would not have mattered.

    This is why we ask for realistic sample data - things often get over-simplified and crucial information left out.

    Thanks for stepping in, Paul!

  16. #16
    Registered User
    Join Date
    07-18-2018
    Location
    England
    MS-Off Ver
    2016
    Posts
    84

    Re: 2016 excel: Skip & ignore empty cells in formula

    It works now!!!

    I just had to increase the lookup array to cover 9000+ rows of data,

    Such a helpful bunch, thanks so much.

    Quick question, i intend on updating the files MON.xlsx TUE.xlsx WED.xlsx THU.xlsx etc. by replacing them in the folder they currently are, same name, same location, just different data.
    Will this update the formula? Or do i need a refresh macro or something?

    Best
    Zach

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: 2016 excel: Skip & ignore empty cells in formula

    While getting one problem solved, we have overlooked another... which is partly my fault...

    The formula you have now is referring to the current workbook to find a match.

    =INDEX('[Fri.xlsx]WHO_DID_WHAT'!$D$1:$D$20,MATCH(1,INDEX(($F16 ='[Fri.xlsx]WHO_DID_WHAT'!$C$2:$C$20)*('[Fri.xlsx]WHO_DID_WHAT'!$D$1:$D$20<>""),0),0))

    If you want to pick up the workbook nname from a cell reference, you can, but... the file MUST be open as the function required (INDIRECT) only works with open files.

+ 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. [SOLVED] Ignore Empty Cells in a Formula
    By olimunden in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-15-2018, 08:20 AM
  2. [SOLVED] Sum formula to ignore empty cells
    By lizsantiago07 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-14-2017, 08:21 PM
  3. [SOLVED] Need a way to ignore empty cells in a sum/countif formula
    By Bniemeyer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-20-2014, 06:09 AM
  4. [SOLVED] Ignore empty cells in an IF formula
    By moppyau in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-09-2013, 06:42 AM
  5. Formula/Macro for copying, skip empty cells
    By joscar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-16-2011, 06:04 PM
  6. How to get a formula to ignore empty cells
    By scudder12 in forum Excel General
    Replies: 1
    Last Post: 10-02-2010, 06:18 PM
  7. Can a formula ignore empty cells?
    By Melissa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-31-2006, 01:30 PM

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