User Defined Function - look for specific value above current cell

alfordtp

Board Regular
Joined
Oct 3, 2008
Messages
62
I have the following Data Set:
1BrandABC
2MFGApple
3Overivew1
4Overview2
5BrandDEF
6MFGPeach
7Overview1
8Overview2
9BrandXYZ
10MFGGrape
11Overview1
12Overview2

<tbody>
</tbody>

I need a user defined function that will look up the brand and place it in the blank cells. In the above example, the blank cells in rows 3 and 4 would say "Apple" for the brand. "Peach" would go in rows 7 and 8, and "Grape" would go in rows 11 and 12. The brand is not always two rows above the first overview cell, so it needs to go up until it reaches brand and save that as the value for the blank cell.

Hope I'm explaining this enough. Let me know if there are any questions. Thanks in advance.

Tim
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Is MFG always in the cell next to the value you want in the empty cells?
 
Upvote 0
yes, that is true. In reference to the active cell (blank cell), the MFG is always above it. there may be other information between it though. I modified the table to show this.

1BrandABC
2MFGApple
3Overivew1
4Overview2
5BrandDEF
6MFGPeach
7Ordercode231
8Overview1
9BrandXYZ
10MFGGrape
11Overview1
12Overview2

<tbody>
</tbody>


Basically I want the Brand to show up in all cells next to the "overview" cells. Since there will be multiple brands, it should reflect the brand that it first encounters going upward.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,159
Messages
6,123,345
Members
449,097
Latest member
thnirmitha

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