# Thread: Bit of a Tricky One Thanks:  5 Post #5299767 (1)Post #5299825 (1)Post #5299769 (1)Post #5299782 (1)Post #5299789 (1) Likes:  3 Post #5299825 (1)Post #5299782 (1)Post #5299789 (1)

1. ## Bit of a Tricky One

Hello,

I have a bit of a tricky one, maybe. I have formulas in both cells A1 and B1 that will either return a value or be left blank. What I would like to do is create another formula in cell D1 that returns the value of cell C1, but only if either cells A1 or B1 have values in them (not blank). I think I'm close with this formula in cell D1: IF(or(A1>0,B1>0),(C1,"")

2. ## Re: Bit of a Tricky One

Try

=IF(OR(A1>0,B1>0),C1,"")

3. ## Re: Bit of a Tricky One

You are close. It is:
Code:
`=IF(OR(A1>0,B1>0),C1,"")`
(you just had an extra parenthesis)

4. ## Re: Bit of a Tricky One

There are formulas in A1 and B1 however, that either return a value or remain blank. The formula you gave me works, but even if both the formulas in A1/B1 cells are returning a blank cell D1 is still populating the value in C1. If I delete the formulas out of A1/B1 then D1 becomes empty.

5. ## Re: Bit of a Tricky One

Are you formulas in A1 and B1 REALLY returning nothing, or are they returning a single space (" ")?
Can you post the formulas in those cells?

Maybe try:
Code:
`IF(OR(LEN(TRIM(A1))>0,LEN(TRIM(B1))>0),C1,"")`
which will ignore blank spaces.

6. ## Re: Bit of a Tricky One

Can u provide what formulas do you have in A1 & B1

7. ## Re: Bit of a Tricky One

A1
=IF(OR(Input!F103="large-22",Input!F103="large-25.4"),(VLOOKUP(B103,'B:\Menu Database\[BeerDatabase1.xlsx]Sheet1'!\$A\$3:\$AN\$40000,40,FALSE)),"")

B1
=IF(OR(Input!F103="small-12",Input!F103="small-16.9"),(VLOOKUP(TOAST!B103,'B:\Menu Database\[BeerDatabase1.xlsx]Sheet1'!\$A\$3:\$AO\$40000,41,FALSE)),"")

8. ## Re: Bit of a Tricky One

Did you try the updated formula I provided?
Did that work?

9. ## Re: Bit of a Tricky One

That worked, thank you! Sorry about the delay, too many formulas in my spreadsheet cause it to error out for a bit before coming back up.

10. ## Re: Bit of a Tricky One

You are welcome.

Do you ever have instances in which your VLOOKUP does not find what it is looking for and returns an error?
If so, you should wrap the VLOOKUP in an IFERROR statement, i.e.
Code:
`=IF(OR(Input!F103="large-22",Input!F103="large-25.4"),IFERROR(VLOOKUP(B103,'B:\Menu Database\[BeerDatabase1.xlsx]Sheet1'!\$A\$3:\$AN\$40000,40,FALSE),""),"")`
which return a blank in the event of not finding a match.

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•