Keep cell empty unless condition is met

RodneyW

Active Member
Joined
Sep 24, 2010
Messages
470
Office Version
  1. 2013
Platform
  1. Windows
I'm using this formula =VLOOKUP($C$5,Data!$D$2:$E$123,2,FALSE) in cell E5. I need to modify this so that if cell D5 is empty, cell E5 will also be empty. Only if cell D5 has content, will the formula kick in and display a value.

Thanks in advance
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi RodneyW,

This might work using an if statement first

=IF(D5="", "", VLOOKUP($C$5, Data!$D$2:$E$123, 2, FALSE))


Also X lookup would work

=IF(D5="", "", XLOOKUP($C$5, Data!$D$2:$D$123, Data!$E$2:$E$123, ""))

hope this helps
plettieri
 
Upvote 0
Xlookup will not work as the OP's profile clearly shows 2013, which does not have xlookup.
 
Upvote 0
yes you are correct...I. missed the excel version indicated by the OP

plettieri
 
Upvote 0
Hi RodneyW,

This might work using an if statement first

=IF(D5="", "", VLOOKUP($C$5, Data!$D$2:$E$123, 2, FALSE))


Also X lookup would work

=IF(D5="", "", XLOOKUP($C$5, Data!$D$2:$D$123, Data!$E$2:$E$123, ""))

hope this helps
plettieri
Thanks for the help. I can get the first to work but it exposes another issue. I describe the issue after the first paragraph below but the paragraph directly below has what may be an alternative solution.
====
I may be able to use my original formula =VLOOKUP($C$5,Data!$D$2:$E$123,2,FALSE) but putting conditional formatting on cell E5 saying if D5 is empty, color the font this color. Something along the lines of =IF($D$5,""). Any ideas?
====

The exposed issue---- If Calculation Options are turned to automatic, it works perfectly. I have Calculation options turned to MANUAL because cell C5 has this formula.

=INDEX(Data!$D$3:$D$122,RANDBETWEEN(1,COUNTA(Data!$D$3:$D$122)))

The form I'm creating needs to allow a user to enter a value in D5 (3 character airport code such as LAX) that is their answer to "what is the airport code for the city shown in C5". If calculation options are turned to automatic, the value in C5 changes every time anything is done in another cell, including the value in C5. If I change calculation options to Manual, then C5 doesn't change until I hit F9, which forces the calculations to take place. When calculations are set to manual, neither of your formulas work.

Thanks for your continued help.
 
Upvote 0
Does that mean you are no longer using 2013?

For the CF you can use
Excel Formula:
=D$5$=""
and set the format how you wish.
Fluff, you're CF code solved the problem. Note, I edited the response above, I was moving too quick and posted a incorrect response. Xlookup didn't work. I am still using 2023.

THANKS ALL FOR THE HELP
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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