Formula to return value if cells above and below are populated

Mr2017

Well-known Member
Joined
Nov 28, 2016
Messages
644
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I’ve got a vlookup in one sheet that looks up data from another sheet.

However, there are a number of instances where there is no matching data, so the formula has been written to return a blank instead of an error.

But I’d like to to create a formula which returns the value of the cell below the active cell IF the value of the cells above and below the active cell are the same

Eg

If cell A1 had the word “Cool”

Cell A2 was blank and

Cell A3 had the word “Cool”

I’d want the value of cell A2 to be “Cool.”

Has anyone done this before?

TIA
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Just add the IF condition, something like:

=if[and(vlookup(...)="", A1=A3),A1, vlookup(...)]

I hope it helps!
 
Upvote 0
Ok, cool!

Thanks - I’ll try that out tomorrow!
 
Upvote 0
Thanks - I initially got a circular reference error when I tried to combine all the info in one formula, but I added in a new column and was able to create a formula which did what I wanted using the elements of what you described above.

Thanks again for your response.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,212
Members
452,618
Latest member
Tam84

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