How to use the search in an if statement

T

trinamariem

I have a spreadsheet with numbers in column B and letters in column C. I
need to search for "J" in Column C and if there is not a J there and there is
a number >0 in Column B, I need to put a "B" in Column D. I figured out the
search function, but when there is not a J, I am just getting an error, what
formula should can I use?
 
E

Eva

Hi
Use the formula below:

=IF(ISERROR(SEARCH("j",C5,1))=TRUE,0,IF(B5>0,"B",0))
For the ones that there are not "J", the formula returns 0,if there is J but
the number is less than 0, then also returns 0
Click yes if helped
 
T

trinamariem

I put that into my spreadsheet and its not working for me. I updated the
cell references to my actual cells and changed the 0 to "". My column B is
56, Column C is D1 and the result is 0 when I would expect a B. I did the
formula auditing so I could try to understand what was happening and it shows
me this:

IF(ISERROR(SEARCH("J',C12,1))=TRUE,"",IF(B12>0,"B",""))
IF(ISERROR(SEARCH("J',"D1",1))=TRUE,"",IF(B12>0,"B",""))
IF(ISERROR(#VALUE!)=TRUE,"",IF(B12>0,"B",""))
IF(TRUE=TRUE,"",IF(B12>0,"B",""))
IF(TRUE,"",IF(B12>0,"B",""))
then it goes to blank
 

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