Bit of a Tricky One

boojooo

New Member
Joined
Nov 15, 2012
Messages
33
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,"")
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
You are close. It is:
Code:
[COLOR=#333333]=IF(OR(A1>0,B1>0),C1,"")[/COLOR]
(you just had an extra parenthesis)
 
Last edited:
Upvote 0
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.
 
Upvote 0
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:
[COLOR=#333333]IF(OR(LEN(TRIM(A1))>0,[/COLOR]LEN(TRIM(B1))>0),C1,"")
which will ignore blank spaces.
 
Upvote 0
Can u provide what formulas do you have in A1 & B1
 
Upvote 0
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)),"")
 
Upvote 0
Did you try the updated formula I provided?
Did that work?
 
Upvote 0
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.
 
Upvote 0
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:
[COLOR=#333333]=IF(OR(Input!F103="large-22",Input!F103="large-25.4"),[/COLOR][COLOR=#ff0000]IFERROR[/COLOR][COLOR=#333333](VLOOKUP(B103,'B:\Menu Database\[BeerDatabase1.xlsx]Sheet1'!$A$3:$AN$40000,40,FALSE),[/COLOR][COLOR=#ff0000]""[/COLOR][COLOR=#333333]),"")[/COLOR]
which return a blank in the event of not finding a match.
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,144
Members
453,021
Latest member
Justyna P

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