Need a code to insert formula if a cell has data

katkth7533

New Member
Joined
Aug 18, 2014
Messages
14
Hi there! Is there a way to insert a code/ formula so that I will get a result IF there is data in another cell? Right now, the formula gives me an error message when one of the fields is empty. In my example, I have a vlookup formula in cell C24 [=VLOOKUP(BQ24;CE8:CF41;2)] but cell BQ24 may not always have data in it. Cell C24 is part of a range that has this vlookup formula in it (with BQ24 being renamed for different cells) and totals to another cell (cell AA1). If BQ24 is blank, I get an error message (#N/A) in cell AA1. I am trying to overcome the error message in case BQ24 has no data without having to add or delete the vlookup formula every time.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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