+ Reply to Thread
Results 1 to 27 of 27

Formula to return empty string instead of null when column table is empty

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Formula to return empty string instead of null when column table is empty

    Hi,

    i am using formula like here:

    Please Login or Register  to view this content.
    but if "ProviderFulfillment" will be empty i will get 0 as result. I do not want it. I want to get "" as result if value in column is empty.
    How can i check this? What statement i can use?

    Please help,
    Jacek

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

    Re: Formula to return empty string instead of null when column table is empty

    Maybe try this:

    =IFERROR(1/(1/IFERROR(INDEX(INDIRECT("t_datacapacity[ProviderFulfillment]");MATCH('Shared Storage'!$H$2&"-"&Vn_Comp_Shared_Storage_Server_Type&"-"&Vn_Input_Shared_Storage_Production&"-"&"0";INDIRECT("t_DataCapacity[OridinalKey]");0));"Invalid configuration")),"")
    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
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    Hi Ali,

    thanks but this is not working
    I am getting:

    Please Login or Register  to view this content.
    and this is error...but result is ok so should return it

    Best,
    Jacek

  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,953

    Re: Formula to return empty string instead of null when column table is empty

    You've missed a closing bracket - check what I gave you carefully - it's in red.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    I added exact what you Aded Ali:

    Please Login or Register  to view this content.
    Attached Images Attached Images

  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,953

    Re: Formula to return empty string instead of null when column table is empty

    Did you replace commas with semi-colons???

  7. #7
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    yes i have to because i am using Polish Excel settings.

    in my case ";" = "," from your settings

    Jacek

  8. #8
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    I am attaching example.

    I could add if statement using LEN function but it will be very long...

    Jacek
    Attached Images Attached Images
    Attached Files Attached Files

  9. #9
    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,953

    Re: Formula to return empty string instead of null when column table is empty

    Look:

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    4
    1
    Paul
    5
    2
    Here i want to get ""
    Sheet: Sheet1

    Excel 2016 (Windows) 32 bit
    B
    5
    =IFERROR(1/(1/IFERROR(INDEX(INDIRECT("t_datacapacity[B]"),MATCH(A5,INDIRECT("t_DataCapacity[A]"),0)),"Invalid configuration")),"")
    Sheet: Sheet1
    Attached Files Attached Files
    Last edited by AliGW; 11-29-2019 at 10:01 AM.

  10. #10
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    Hi,

    yes it is working! But if you will go with this formula where you not have error (B4 cell in example) i will have:
    Please Login or Register  to view this content.
    And here you will get error because 1/Paul it is error...
    Maybe any other solutions?

    Best,
    Jacek

    p.s. thanks for warning me that i can not send private messages on forum. I didnt know that especially if you PM me with thanks for rep.

  11. #11
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula to return empty string instead of null when column table is empty

    Try this in B5
    =IFERROR(INDEX(INDIRECT("t_datacapacity[B]");MATCH(A5;INDIRECT("t_DataCapacity[A]");0))&"";"Invalid configuration")

  12. #12
    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,953

    Re: Formula to return empty string instead of null when column table is empty

    Quote Originally Posted by jaryszek View Post
    p.s. thanks for warning me that i can not send private messages on forum. I didnt know that especially if you PM me with thanks for rep.
    There is no rule against private messages per se. I send visitor messages, not private messages, to say 'thank you' for rep.

    Read the rule again:

    Don't private message, visitor message or email Excel (or Access, Word, etc.) questions to moderators or other members.

    You sent me a private message to prompt for help with your thread: that is not allowed. Private messages are for private matters, not for follow-up questions about your issue.

    Your message was this:

    Did your formula work for you in Example attached workbook in topic from today morning?
    This is not a private matter: it's related to your thread and should have been posted here.
    Last edited by AliGW; 11-30-2019 at 01:58 PM.

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

    Re: Formula to return empty string instead of null when column table is empty

    Try this formula in B4:

    =IF(COUNTIF(INDIRECT("t_DataCapacity[A]"),A4),IFERROR(INDEX(INDIRECT("t_datacapacity[B]"),MATCH(A4,INDIRECT("t_DataCapacity[A]"),0))&"","Invalid configuration"),"")

    Change the commas ( , ) to semicolons ( ; ), as previously advised, then copy down.

    Hope this helps.

    Pete

  14. #14
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    Hi Pete_Uk, Bo_Ry,

    thank you!

    Please Login or Register  to view this content.
    Why just not use?

    Please Login or Register  to view this content.
    Best,
    Jacek

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

    Re: Formula to return empty string instead of null when column table is empty

    I thought you wanted to return a blank if A4 can't be found, hence the COUNTIF at the beginning to check for this.

    Anyway, thanks for the rep.

    Pete

  16. #16
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    Hi Guys,

    i have to unfortunately reopen the topic.
    If i have number in table it will be converted to text with
    & ""
    .

    It is possible to check if this is a number or text in nice, short way?
    If thisi s a number - do not add &"" in the end, if this is a text - > add &"" in the end.

    Best,
    Jacek
    Last edited by jaryszek; 12-03-2019 at 01:43 AM.

  17. #17
    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,953

    Re: Formula to return empty string instead of null when column table is empty

    Why don't you just provide a sample workbook? It would stop all the guesswork.

  18. #18
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    I provided example in post number #8.

    Best,
    Jacek

  19. #19
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Formula to return empty string instead of null when column table is empty

    A nice way is not using Indirect.

    =IFERROR(IF(ISBLANK(VLOOKUP(A5,t_datacapacity,2,0)),"",VLOOKUP(A5,t_datacapacity,2,0)),"Invalid configuration")

  20. #20
    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,953

    Re: Formula to return empty string instead of null when column table is empty

    Quote Originally Posted by jaryszek View Post
    I provided example in post number #8.
    It's far to simp0listic - it does not reflect the issues you are asking for help with. Your workbook needs to be properly representative of the real data.

  21. #21
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    =IFERROR(IF(ISBLANK(VLOOKUP(A5,t_datacapacity,2,0)),"",VLOOKUP(A5,t_datacapacity,2,0)),"Invalid configuration")
    Thanks. I know that but asking about other thing.

    It's far to simp0listic - it does not reflect the issues you are asking for help with. Your workbook needs to be properly representative of the real data.
    What do not you understand?
    In example is all what you need.

    You can put number in table source or text and see behaviour - formula always is returning text. But sometimes i have number in table source.
    And want to get number as result.

    I think that only way is to write nested if statements.
    If there is a number - use number, if empty - add &"" to the end.

    Someting like Bo_Ry wrote.

    Jacek

  22. #22
    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,953

    Re: Formula to return empty string instead of null when column table is empty

    It's up to you, of course. I'm out.

  23. #23
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Formula to return empty string instead of null when column table is empty

    Hiding zero value can easily be done in the cell formatting by setting the third format element to zero.

    I made custom format "#.##0,00;-#.##0,00;;@"

    the first element (before first semi colon) is for positive numbers
    the second element is for negative numbers
    the third element is for zero values
    the forth element is for text values


    there is no need to change the formula to get this result
    Attached Files Attached Files

  24. #24
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    Thank you Roel very much!

    I have to try this method.
    I am closing topic.

    There is no other possibilities here like Pete_Uk and Bo_Ry and Roel said.

    Best Wishes for all,
    Jacek

  25. #25
    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,063

    Re: Formula to return empty string instead of null when column table is empty

    Why not simply double-up the formula?

    =IFERROR(IF(VLOOKUP(D2,A:B,2,FALSE)=0,"",VLOOKUP(D2,A:B,2,FALSE)),"")

    see sheet. This won't work if zero is a possible REAL answer...
    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

  26. #26
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    thank you Glenn, exactly i will solve using double times formula

    Jacek

  27. #27
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: Formula to return empty string instead of null when column table is empty

    Hi Guys,

    i have to reopen the topic because adding double_up formulas creating very advanced strings which are hard to maintain and change:

    Please Login or Register  to view this content.
    Can anybody has different idea to solve this than double up formula?

    Only one thougt in my mind - to add separated colum for checking if TableColumn Is Null.
    Or replace Empty in Table with "Null" but this is still will required to write 2 times formula...

    Best,
    Jacek

+ 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] getting vlookup to return a null value on an empty line Vs. #N/A
    By mmccra2858 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2016, 02:57 PM
  2. How to delete rows based on whether or not a cell in column B is empty or null
    By Seth_ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2014, 04:35 PM
  3. [SOLVED] Replace empty string with null
    By anteagles20 in forum Excel General
    Replies: 7
    Last Post: 04-08-2014, 07:16 AM
  4. Delete Empty Rows and empty columns from the word table
    By mvneema in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2014, 10:51 AM
  5. Find a cell that has a null value, and replace with an empty string.
    By skania in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2013, 12:49 PM
  6. Replies: 5
    Last Post: 06-07-2012, 05:18 AM
  7. need formula to return last non empty column
    By neowok in forum Excel General
    Replies: 0
    Last Post: 01-06-2005, 09:55 AM

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