Output of the =IF(COUNTA) Function

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.
 
D

David Biddulph

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"">","")
 
E

Excel Helps

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"">","")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top