How to identify first occurrence of a value above a target cell and report value in that cell

ripvw

New Member
Joined
Apr 27, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
This is how I get the dataThis is what I need to convert it
to, through some formula
District 15
Location 25
aDistrict 15Location 25a
bDistrict 15Location 25b
cDistrict 15Location 25c
dDistrict 15Location 25d
eDistrict 15Location 25d
fDistrict 15Location 25d
gDistrict 15Location 25d
location 26
aaDistrict 15Location 26aa
bbDistrict 15Location 26bb
ccDistrict 15Location 26cc
ddDistrict 15Location 26dd
Location 33
a1District 15Location 33a1
b1District 15Location 33b1
c1District 15Location 33c1
d1District 15Location 33d1
e1District 15Location 33e1
District 16
Location 54
aa1District 16Location 54aa1
bb1District 16Location 54bb1
cc1District 16Location 54cc1
dd1District 16Location 54dd1
ee1District 16Location 54ee1
ff1District 16Location 54ff1
gg1District 16Location 54gg1
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try the following...

Cell Formulas
RangeFormula
E6:E32E6=IF(LEFT(C6,8)<>"District",IF(LEFT(C6,8)<>"Location",LOOKUP(2,1/(LEFT($C$4:C6,8)="District"),$C$4:C6),""),"")
F6:F32F6=IF(LEFT(C6,8)<>"District",IF(LEFT(C6,8)<>"Location",LOOKUP(2,1/(LEFT($C$4:C6,8)="Location"),$C$4:C6),""),"")
G6:G32G6=IF(LEFT(C6,8)<>"District",IF(LEFT(C6,8)<>"Location",C6,""),"")


Hope this helps!
 
Upvote 0
Solution
You are awesomeness personified, thank you so much.
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,108
Members
452,302
Latest member
TaMere

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