Getting #VALUE when using IF(OR())

dagda13

New Member
Joined
May 18, 2019
Messages
22
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!
 

Toadstool

Active Member
Joined
Mar 5, 2018
Messages
324
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,""))
 

Forum statistics

Threads
1,081,574
Messages
5,359,704
Members
400,545
Latest member
Damntheman30

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top