get 4 words before a match found included match word

satish78

Board Regular
Joined
Aug 31, 2014
Messages
218
In ColumnA I have sentences wrapped and in columnB list of words

formula should lookup range of words in columnA and get 4 words including matched word.
for example.

Robert is honored in computer science and Robert earned GPA 3.6 and he has a bachelors degree (ColumnA)

3.5 (ColumnB Range)
3.6
3.7
4.9

Robert earned GPA 3.6 (ColumnC result)
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

This is what you are linking us to, instead of posting it as data directly here:

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][/tr][tr][td]
1​
[/td][td]Robert is honored in computer science and Robert earned GPA 3.6 and he has a bachelors degree[/td][td]
3.5
[/td][td]Robert earned GPA 3.6[/td][td][/td][/tr]
[tr][td]
2​
[/td][td][/td][td]
3.6
[/td][td][/td][td][/td][/tr]
[tr][td]
3​
[/td][td][/td][td]
3.7
[/td][td][/td][td][/td][/tr]
[tr][td]
4​
[/td][td][/td][td]
4.9
[/td][td][/td][td][/td][/tr]
[tr][td]
5​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


Note that you don't mention what the conditions are to output the result that you show...
 
Upvote 0
i would like to get data where "3.6" is matched in Row1 the formula should get "robert earned gpa" including "3.6" data in ColumnC

This is what you are linking us to, instead of posting it as data directly here:

[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[TD]
D​
[/TD]
[/TR]
[TR]
[TD]
1​
[/TD]
[TD]Robert is honored in computer science and Robert earned GPA 3.6 and he has a bachelors degree[/TD]
[TD]
3.5
[/TD]
[TD]Robert earned GPA 3.6[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
2​
[/TD]
[TD][/TD]
[TD]
3.6
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
3​
[/TD]
[TD][/TD]
[TD]
3.7
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4​
[/TD]
[TD][/TD]
[TD]
4.9
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Note that you don't mention what the conditions are to output the result that you show...
 
Upvote 0
Hi Aladin,

I want to find "3.6" in columnA, if found, the formula should get "Robert earned GPA" from ColumnA along with "3.6" in preceding ColumnC.(row1)

Hope you understand now.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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