Find data in various positions in a column and return the cell contents

JeffGrant

Well-known Member
Joined
Apr 7, 2021
Messages
516
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am a bit stuck. All assistance is very graciously received and very much appreciated.

Here is my scenario.

I past a column of data into a sheet. No Problem. In the attached sheets, that is Column A.
The first 2 cells in the pasted column data, never change the type of data or the location. So I can extract that easy enough into Column C.
The next 4 cells in the extracted data, Column C, do change the row and can be anywhere in rows 14 to 40. With 3 of the 4 cells, the data is extracted all from the same pasted cell. This is no problem, if I now the row number that it gets pasted to.

I would like to automate the extraction for cells C10, C11 & C13. I am happy to manually type the data for C12, because there are several different types of data here.

For example, some of the data in C12 could be: Mdn HCP, hcp, (c1), (BM60), (bm48+), Class 2, just to name a few. I think there too many variants in this one to automate for now.

I have looked at the Aggregate/Index and Rows functions and I just don't seem to be able to put it together and make it work.

I hope I have pasted the mini-sheet correctly.



Test.xlsx
ABCDEF
5Calculated ResultRequired Result
6Pasted DataMy Formula Attempt, using fixed cell locations
7Comment
8CanterburyTrackCanterburyCanterburyFixed Cell location
9Good (4)ConditionGood (4)Good(4)Fixed Cell location
10Distance (m)12001200Can be anywhere between rows 14 and 40
111Race Number11Can be anywhere between rows 14 and 40
12ClassMdn HCPCan be anywhere between rows 14 and 40
132Time12:45 PM12:45 PMCan be anywhere between rows 14 and 40
14
153
16
174
18
195
20
216
22
237
241200m R1 Vinery Stud Mdn Hcp
2512:45
26
27
28
29
Sheet1
Cell Formulas
RangeFormula
C8C8=INDEX(A8:A28,1,1)
C9C9=INDEX(A8:A28,2,1)
C10C10=VALUE(IF(FIND("m ",A24,1)=5,LEFT(A24,4),LEFT(A24,3)))
C11C11=VALUE(MID(A24,SEARCH("R",A24,1)+1,2))
C13C13=INDEX(A8:A34,18,1)
 
Solved this issue by changing >15 to =MAX(LEN(A1:A40)). Works a treat. Thanks again
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
The Spill errors (none were showing in your post by the way) were most likely because you had more than one cell in the range longer than 15 characters. Your formula below solves that** by looking for the cell with the longest text in the range.

**It would still cause an issue if there was more than one cell with equal longest text, but perhaps that will never happen?

Solved this issue by changing >15 to =MAX(LEN(A1:A40))


Hi Peter, I fixed the #spill error by using a length >20. Using a length >10 increased the spill range to 3 cells.

Where can i learn more about this?
Here is one place to start: Excel Formulas Now Spill Into Adjacent Cells - Major Calc Engine Change - Breaking News
 
Upvote 0

Forum statistics

Threads
1,214,848
Messages
6,121,917
Members
449,055
Latest member
KB13

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