If statement with vlookup(s) - how to return blank rather than N/A for no results

easpeed954

New Member
Joined
Jan 10, 2015
Messages
4
Two questions:

1)

I have an if statement with 2 vlookups and want to augment the formula to return a blank rather than N/A when the lookups yield no results.

Formula I'm using:
=IF(BH61="Parent",VLOOKUP(A:A,A:AI,35,0),VLOOKUP(BH:BH,A:AI,35,0))



2)

I am attempting to concatenate some cells with text strings in the formula but I cannot get a text string that contains quotes (") to work in the formula and thus have to include an absolute cell reference to include the desired text.

So I am using the following formulas:

=CS2&$CT$1&CT2&"</p>"
or
=CONCATENATE(CS2,CT$1&CT2,"</p>"

but would like to instead include the text string rather than the absolute cell reference.

i.e. Excel will not accept the following: =CS2&"<p style="font-size:80%;float:right;padding-right:3%;">Item:"&CT2,&"</p>"


Would like to augment formula to allow <p style="font-size:80%;float:right;padding-right:3%; to replace $CT$1 in the formula


Thank you in advance for anyone who can help.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi easpeed

Firstly welcome to the forum.

Secondly the answer to the first part is =iferror(IF(BH61="Parent",VLOOKUP(A:A,A:AI,35,0),VLOOKUP(BH:BH,A:AI,35,0)),"")

Can you show the source and required output in regard the second query. I'm confused as I believe absolute cell references require $ signs?

Regards
 
Upvote 0
Welcome to the MrExcel board!

You need to double up any internal quote marks.
HTML:
=CS2&"<p style=""font-size:80%;float:right;padding-right:3%;"">Item:"&CT2&"</p>"

Also, if posting anything that the forum software might interpret as html code, you can enclose that text in HTML tags. The syntax is similar to the Code tags description in my signature block below, or look here
 
Upvote 0
Thank you so much Peter. I had actually not provided the correct absolute reference in the example I gave you but was using it in my sheet.

Both of your solutions worked perfectly.

I really appreciate it.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top