+ Reply to Thread
Results 1 to 5 of 5

Which of these formulas is best for checking if a cell is blank or is there a better way?

  1. #1
    Registered User
    Join Date
    01-31-2015
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    91

    Which of these formulas is best for checking if a cell is blank or is there a better way?

    Just a quick question for gathering opinions.

    I use a macro to insert formulas in cells in a column that are blank, no data what so ever in them, and like everything with Excel there is more than one way of doing things so without getting to technical what would you say is the correct way of doing (and why) or is there a better way?
    Baring in mind why I am doing it.

    For anyone who is new to Excel, the formulas look at cell A1 and test if it has data or not, and then displays the appropiate message in the cell in which the formula is entered. If you want to run another piece of code if, for example, the cell is blank, you can replace the words "No Data" including the " character with your code.

    Method A
    Please Login or Register  to view this content.
    Method B
    Please Login or Register  to view this content.
    Method C
    Please Login or Register  to view this content.
    Method D
    Please Login or Register  to view this content.

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

    Re: Which of these formulas is best for checking if a cell is blank or is there a better w

    I tend to use method A - method C is checking the opposite.
    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 Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Which of these formulas is best for checking if a cell is blank or is there a better w

    Depends on what you are trying to do:
    If you have a formula in A1 which is returning null set (""), then Method B will give you "Has Data" because the cell is not blank. Excel sees the "" as text also.
    Method D is probably not an option as it will return "No Data" for 0 and negative numbers.
    Methods A and C are mirror images of each other so either would work.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    01-31-2015
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    91

    Re: Which of these formulas is best for checking if a cell is blank or is there a better w

    Quote Originally Posted by AliGW View Post
    I tend to use method A - method C is checking the opposite.
    Hi Ali

    Many thanks, that was my choice also.

  5. #5
    Registered User
    Join Date
    01-31-2015
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    91

    Re: Which of these formulas is best for checking if a cell is blank or is there a better w

    Quote Originally Posted by ChemistB View Post
    Depends on what you are trying to do:
    If you have a formula in A1 which is returning null set (""), then Method B will give you "Has Data" because the cell is not blank. Excel sees the "" as text also.
    Method D is probably not an option as it will return "No Data" for 0 and negative numbers.
    Methods A and C are mirror images of each other so either would work.
    Hi Chemist

    Many thanks, Method A is my choice

+ 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] checking for a blank cell and returning blank in another as part of a nested IF formula
    By 1learning excel1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-25-2019, 07:05 AM
  2. Replies: 11
    Last Post: 09-15-2014, 02:36 AM
  3. Help with Formulas, how to keep a cell blank
    By stevedd01 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-20-2013, 02:00 PM
  4. Skipping a blank cell and checking next cell in a column
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-17-2013, 11:11 PM
  5. Checking to see if cell is empty / blank
    By plannerg in forum Excel General
    Replies: 2
    Last Post: 08-23-2009, 07:49 PM
  6. checking for blank cell
    By onthecauseway in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-16-2009, 06:43 AM
  7. Excel formulas for checking contents within a cell.?
    By Aubbie in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-02-2008, 03:22 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