IF Worksheet function

amitshah

Board Regular
Joined
Apr 13, 2002
Messages
80
I am using an IF function in my worksheet to check if the cell contains "#N/A" (this value is got by using the VLOOKUP function).

Using the IF condition as follows:

CellA1 - "Some Text"
CellB1 - "#N/A" (got when vlookup was unsuccessful)
CellC1 - =IF(A1<>"#N/A", A1&" "&B2, A1)

so in this case if cellB1 contains some other text eg. "some other text" then cell C1 would display "Some Text some other text" ie it concatenates text from cell A1 and B1. If it has "#N/A" in cell B1 then cell C1 should display "Some Text".

But in this case it display "#N/A".

Can anyone know why? I am quite sure the IF formula is correct.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Cell C1 must be:
=IF(B1<>"#NA",A1&" "&B1,A1)
This message was edited by Albert 1 on 2002-04-15 18:59
 
Upvote 0
Thanks for that .....

I am sorry I actually wrote the wrong formula in my question ...... I actually did

=IF(B1<>"#N/A", A1&" "&B1, A1)

but its gives me "#N/A" in C1
 
Upvote 0
i don't think looking for the text string #N/A will work if the "#N/A" is what a formula is returning. i think this will work though:

=IF(ISNA(B1),A1,A1&" "&B1)
This message was edited by anno on 2002-04-15 19:02
This message was edited by anno on 2002-04-15 19:03
 
Upvote 0
Hi Amit and Albert:
I don't quite know Amit's intent, but the above formula does not work. I believe you want to capture the occurrence of #N/A by using NOT(ISERROR) ...

=IF(NOT(ISERROR(B1)),A1&" "&B2,A1)

Albert: You must be using a European version of Excel -- you are using ; as an argument separator, in North American version we use , as an argument separator.

HTH!
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,374
Members
448,888
Latest member
Arle8907

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