Output of the =IF(COUNTA) Function

  • Thread starter Thread starter Excel Helps
  • Start date Start date
E

Excel Helps

=IF(COUNTA(Original_Data!Y8:Z8)>0,"test.jpg","")

=IF(COUNTA(Original_Data!Y8:Z8)>0,"<img
src="images/shirts/large/check.jpg">,"")

I am using the function in line 1 to pull data from cells in a worksheet
called Original_Data.
I have tested the fuction using an output called test.jpg.
The function works and put's test.jpg in the correct cells in one worksheet
corresponding to cells in another worksheet that have data and ignores cells
that don't.

My problem is that I need the output to be:
<img src="images/shirts/large/check.jpg">

Rather than test.jpg

Could someone please advise me how to configure the basic function to
achieve this?
Thanks.
 
Firstly, you missed out the quote marks aftere the closing brace before the
comma in the IF function.
Secondly, if you wish to include quote marks within a string, you need to
double them.

Try
=IF(COUNTA(Original_Data!Y8:Z8)>0,"<img
src=""images/shirts/large/check.jpg"">","")
 
Thanks, David
It works perfectly.


David Biddulph said:
Firstly, you missed out the quote marks aftere the closing brace before the
comma in the IF function.
Secondly, if you wish to include quote marks within a string, you need to
double them.

Try
=IF(COUNTA(Original_Data!Y8:Z8)>0,"<img
src=""images/shirts/large/check.jpg"">","")
 
Back
Top