Solved

Extract Data

Posted on 2011-09-09
7
307 Views
Last Modified: 2012-05-12
Hello all, I am tyring to extract a weather observation.  I need to get the temperature for a weather reports.  The example below is in cell A1.  I need to get the value 23 into cell c34.  Some things that are constant in a weather observation it is always preceded by the first "/" there can be mulitple "/" but the temperature is always before the first "/"  also the value can be either two digits or a "M"followed by 2 digits, like M12, which is equal to minus 12.  How can i get a way to extract this data.

KICT 092253Z 02006KT 10SM TS BKN075CB OVC110 23/15 A3001
0
Comment
Question by:sandramac
  • 4
  • 2
7 Comments
 
LVL 80

Accepted Solution

by:
byundt earned 500 total points
Comment Utility
Try the following formula:
=--SUBSTITUTE(RIGHT(LEFT(A1,FIND("/",A1)-1),3),"M","-")
0
 

Author Closing Comment

by:sandramac
Comment Utility
Thank it works,
0
 
LVL 80

Expert Comment

by:byundt
Comment Utility
With hindsight, I see that I can shorten the formula to:
=--SUBSTITUTE(MID(A1,FIND("/",A1)-3,3),"M","-")
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 18

Expert Comment

by:Curt Lindstrom
Comment Utility
Brad, one digit positive temperatures will produce a #VALUE! error with your formula

KICT 092253Z 02006KT 10SM TS BKN075CB OVC110 3/15 A3001

Curt
0
 
LVL 80

Expert Comment

by:byundt
Comment Utility
Curt,
I assumed temperatures between -9 and +9 would be written as M09 or 09 with a leading 0. If that should not be the case, then the following will work:
=--SUBSTITUTE(MID(SUBSTITUTE(A1," ","  "),FIND("/",SUBSTITUTE(A1," ","  "))-3,3),"M","-")
It substitutes two spaces for every one in the original text.

Brad
0
 
LVL 18

Expert Comment

by:Curt Lindstrom
Comment Utility
Brad,
I was thinking:

=IF(ISERR(--SUBSTITUTE(MID(A1,FIND("/",A1)-3,3),"M","-")),--SUBSTITUTE(MID(A1,FIND("/",A1)-2,2),"M","-"),--SUBSTITUTE(MID(A1,FIND("/",A1)-3,3),"M","-"))

..but as always you find the most efficient formula to solve a problem :-)

Cheers,
Curt

0
 
LVL 80

Expert Comment

by:byundt
Comment Utility
Curt,
In Excel 2007 or later, your approach might become:
=IFERROR(--SUBSTITUTE(MID(A1,FIND("/",A1)-3,3),"M","-"),--MID(A1,FIND("/",A1)-1,1))

Brad
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now