0

I am currently using W8 and Excel 2010. I am trying to write what I thought was a straightforward "IF" function for each cell in a column; whereby if a specific cell in the same row is blank, I want the cell containing the formula also to display blank. If not then I want a default text to appear. Here is my formula entered in F2:

=If(A2="";"";"default text"). 

Column A contains a name and if it contains any text, then the default text is intended to be a hyperlinked address to the person's photograph on the same disk drive.

The problem is the formula won't work and it highlights "" as being the error when trying to express blank.

Any help would be appreciated. Thanks.

3 Answers 3

0

Your formula just needs commas instead of semi colons. The working version should be as follows: =If(A2="","","default text")

1
  • The semicolons are likely just a difference in regional settings.
    – Excellll
    Jun 18, 2014 at 15:29
0

To cope with the possibility that A2 could either be a blank string, or an empty cell, I would recode the function as follows:

=If(len(A2)=0;"";"default text")

I'm assuming your use of semi-colons is due to your locale. If not, you need to substitute them with commas.

0

For those instances as you described, I use an IS function to determine if the cell is empty; specifically ISBLANK.

Each of these functions, referred to collectively as the IS functions, checks the type of value and returns TRUE or FALSE depending on the outcome. For example, the ISBLANK function returns the logical value TRUE if value is a reference to an empty cell; otherwise it returns FALSE.

Therefore, you can nest the ISBLANK in you IF statement as follows.

=If(ISBLANK(A2);"";"default text")

If it finds A2 to be blank, it will leave it blank, otherwise it will display the default text.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .