To extract specific numbers from a range

sparkerk1

New Member
Joined
Nov 1, 2017
Messages
18
Office Version
  1. 2016
Platform
  1. Windows
Dear team,

I want to extract specific number from below , the below text when copied in excel comes in 6 rows, the criteria is to extract the INR FARE 44500 (only numbers required) from second line and Ignore the "USD" line, also sometime the second line comes as first and the first comes as second so it should be able extract only the number inr the "INR" only , this formula should revolve in the first 2 line only

Eg: if first Lines contains USD its should skip that part and jump on the next line and find the "INR" and give out the result "44500"
also if The "INR" line comes in the first row its should extract the and same and skip the second line.



USD 688.00 07NOV17BOM QR X/DOH QR X/SAO G3 RIO688.00
INR 44500 NUC688.00END ROE1.000000
INR 10834YQ XT INR 2787K3 INR 850YM INR 258IN INR 154
INR 388YR WO INR 614G4 INR 33PZ INR 584BR
INR 5280XT
INR 61002
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Does this formula do what you want...

=0+IF(LEFT(A1,3)="INR",MID(A1,FIND(" ",A1),FIND(" ",A1,5)-4),MID(A2,FIND(" ",A2),FIND(" ",A2,5)-4))
 
Upvote 0
Does this formula do what you want...

=0+IF(LEFT(A1,3)="INR",MID(A1,FIND(" ",A1),FIND(" ",A1,5)-4),MID(A2,FIND(" ",A2),FIND(" ",A2,5)-4))

Dear Sir,

Tried your above formula but getting below error


0
 
Upvote 0
Sparkerk1,

try this:
Code:
[COLOR=#000000][FONT=Arial]=MID([/FONT][/COLOR][COLOR=#008000][FONT=Arial]INDEX(A1:A2,[COLOR=#0000FF]MMULT({1,2},--[COLOR=#FF0000]ISNUMBER([COLOR=#804000]SEARCH("INR",A1:A2)[/COLOR])[/COLOR])[/COLOR])[/FONT][/COLOR][COLOR=#000000][FONT=Arial],5,5)[/FONT][/COLOR]

 
Upvote 0
Sparkerk1,

try this:
Code:
[COLOR=#000000][FONT=Arial]=MID([/FONT][/COLOR][COLOR=#008000][FONT=Arial]INDEX(A1:A2,[COLOR=#0000FF]MMULT({1,2},--[COLOR=#FF0000]ISNUMBER([COLOR=#804000]SEARCH("INR",A1:A2)[/COLOR])[/COLOR])[/COLOR])[/FONT][/COLOR][COLOR=#000000][FONT=Arial],5,5)[/FONT][/COLOR]


Dear Sir,

Thx above method worked fine only I had to change value of the last Digit to 8 to make the entire digits appear.

=MID(INDEX(A1:A2,MMULT({1,2},--ISNUMBER(SEARCH("INR",A1:A2)))),5,5)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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