+ Reply to Thread
Results 1 to 25 of 25

If blank leave blank

  1. #1
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    If blank leave blank

    Hi

    I have lots of lookup formulas in my workbook which looks up prices. But all the N/A really annoys me when some cells are not needing to lookup so I seen a formula briefly which looks along the lines of
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    But I want this incorporated with my lookup and wrote the following:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    which will display £- all the time?????

    What have I done wrong?????

    Thanks.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If blank leave blank

    Maybe use IFERROR..

    =IFERROR(VLOOKUP($B6,Costings!$B$5:$E$139,2,FALSE)),""")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    Comes up with "you've entered few to arguments"

  4. #4
    Registered User
    Join Date
    11-16-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: If blank leave blank

    Please Login or Register  to view this content.
    , perhaps?

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If blank leave blank

    =IFERROR(VLOOKUP($B6,Costings!$B$5:$E$139,2,FALSE),""")

    "Play" with parenthesis....

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: If blank leave blank

    @Fotis1991,

    The error comes from an extra quote...

    =IFERROR(VLOOKUP($B6,Costings!$B$5:$E$139,2,FALSE),""")
    HTH
    Regards, Jeff

  7. #7
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    So far so good! I'll start putting this across the first set of cells and see what happens!

    Thanks!!!!

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: If blank leave blank

    Quote Originally Posted by jeffreybrown View Post
    @Fotis1991,

    The error comes from an extra quote...

    =IFERROR(VLOOKUP($B6,Costings!$B$5:$E$139,2,FALSE),""")
    This happens when i don't use my glasses.

  9. #9
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    It will automatically insert an extra " then will display " in place, which looks better but would be great if it was actually blank?
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: If blank leave blank

    Did you try...


    =IFERROR(VLOOKUP($B6,Costings!$B$5:$E$139,2,FALSE),"")

    ...which basically says, if the VLOOKUP produces an error, show a blank ("")

  11. #11
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    Yes that works, This gives the result I'm looking for! I did this earlier without realising but made a mistake else where so had to start again, then went with the 3" which led to 4 of them and so on blah blah, lol. Thanks guys!

  12. #12
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: If blank leave blank

    In the end, glad you have your solution

    Thanks for the feedback and we are happy to have helped.

  13. #13
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    I have gone to save it as 97-2003 due to compatibility at work.
    then it comes up with.

    "one or more functions in this workbook are not available in earlier versions of excel. When recalculated in earlier versions, these functions will return a #NAME? error instead of location"

    So does this mean where i would of had a list of #N/A I will now have lists of #NAME? when running on the previous version of excel, which basically means I'll be wasting my time putting this into pages of formulas???

  14. #14
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: If blank leave blank

    What's happening, IFERROR applies only to 2007+, therefore, because of compatibility issues with versions below 2007 you receive the #NAME? error.

    Instead you would need to use...

    =IF(ISNA(VLOOKUP($B6,Costings!$B$5:$E$139,2,FALSE)),"",VLOOKUP($B6,Costings!$B$5:$E$139,2,FALSE))
    Last edited by jeffreybrown; 12-27-2012 at 04:31 PM.

  15. #15
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    Ok I'll paste this in and check when I'm in work next!

    How would I go about the following then??

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


    AND


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


    I would guess that I would have to write =IF(ISNA(K6:M6),"",(K6:M6)) ?????


    Thanks! You've been a great help!

  16. #16
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: If blank leave blank

    What do you want to happen?

    =(J6*N6)-(G6*L6) >> If this is in a cell and all the linked cells are blank it returns 0

    =SUM(K6:M6) >> Same Here

  17. #17
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: If blank leave blank

    If you merely do not want to see the zero if zero...

    Two options to consider before modifying the formulas...

    Hide Zero’s
    • Highlight range >> Ctrl + 1 >> Number tab >> Category: Custom >> Type: 0;;;@
    • Office Button >> Excel Options >> Advanced >> Display Options for this worksheet: Uncheck Show as zero

  18. #18
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    the one with the LOOKUP formula now works well (on this PC at least)

    This one
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Displays #VALUE now but when things are in-putted it works as normal. Its just when nothing is in the lookup cell I dont want all these ugly #VALUE texts on the sheet


    and this one
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Just displays £0.00 which don't look bad, but I like things looking neat


    I need to shoot of myself now, so will have a look tomorrow sometime!


    Thanks for your help

  19. #19
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: If blank leave blank

    If you don't particularly like the idea of hiding a zero value with the custom format...

    Change this
    Please Login or Register  to view this content.
    To this >> which will only sum K8:M8 if all three cells contain a number
    Please Login or Register  to view this content.
    For this
    Please Login or Register  to view this content.
    Not sure why you would get #VALUE when those four cells are empty. As I said, I get zero.

    If I happen to put text in one of those cells I will get #VALUE, but not sure that would be the case.

    Can you post a small sample showing the #VALUE?

  20. #20
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    I'm on my phone at the moment. I'll try them, but will have to change the count to 1 on your first example due to there will only be a maximum of two cells which will return a value depending on what the lookup returns. Basically the lookup goes through and return in each of the 3 cells a UNIT price per "part" so two cells may return a zero or only one, then the second example times a total from elsewhere times by the unit costs.
    So if there is nothing to lookup, the first 3 cells will be blank but that last cell will say VALUE.
    If this plays up, I will attach an example sheet which will be much easier/clearer than my explanations

  21. #21
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    Here is a sample, everything is unprotected and some names changed. And a couple of sheets have been deleted to bring the size down.

    Basically look at sheet: 3DAYS and columns B,K,L,M,N,O. And this should make sense.

    K,L,M have been modified, but if you need to see the original formulas, look on sheets 4 days, 3 nights, 4 nights in the same columns.

    These formulas when modified, could also affect data in the OVERVIEW sheets?????

    many thanks

    sample.xls

  22. #22
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,848

    Re: If blank leave blank

    Put this formula in cell K6 of the 3_nights sheet:

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


    Then you can copy it into L6 and M6, and then copy these down.

    You have a complex custom format applied to cells N6:N19 which shows you the £ sign without any data - you might like to change the formatting to Currency with 2dp, though you will still see £0.00 with no data. In O6 you can use this formula:

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


    and then copy this down.

    Hope this helps.

    Pete

  23. #23
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    To be honest, I thought I had already changed all the formats to currency £. So I'll have to change these by the sounds of it! I must have changed one, but when pasting down, I must have copied from the wrong cell to begin with.
    I'll try this out when I'm back on again!
    Thanks

  24. #24
    Forum Contributor
    Join Date
    10-16-2009
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    257

    Re: If blank leave blank

    All works well now! Didn't think it would lead to all this just to make the pages look tidier! Thanks guys for your help!

  25. #25
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: If blank leave blank

    You're welcome and thanks for the feedback. We are glad to have helped and happy it worked out for you ...

+ Reply to Thread

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