Getting #VALUE when using IF(OR())

dagda13

Board Regular
Joined
May 18, 2019
Messages
52
Hi,

I'm trying to return the value of a couple cells, depending upon whether or not they contain a value. I'm using the formula below:

=IF(OR(IF(NOT(ISBLANK(SEARCH($BP$2,B2))),$BP$2,""),IF(NOT(ISBLANK(SEARCH($BP$3,B2))),$BP$3,"")),"")

The idea is that either BP2 or BP3 will contain a value, or if neither of them contain a value, the returned value will be blank. In this case, whether or not BP2 or BP3 contain a value or not, I'm getting #VALUE .

I'm expecting the returned value to be whatever value BP2 or BP3 has, or blank. But I don't understand why I'm getting #VALUE .

Any help would be very much appreciated!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I'm not sure why you're referencing B2 but does this do what you want?
=IF(ISNUMBER($BP$2),BP2,IF(ISNUMBER($BP$3),BP3,""))
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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