Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-08-2016, 07:51 PM
guthrie guthrie is offline text-to-Fields failing - how get null for missing values? Windows 7 64bit text-to-Fields failing - how get null for missing values? Office 2010 64bit
Novice
text-to-Fields failing - how get null for missing values?
 
Join Date: Mar 2011
Posts: 10
guthrie is on a distinguished road
Default text-to-Fields failing - how get null for missing values?

I have a table of imported data (from an “external data source” URL web page).
The original data fields (wind reports) look like this: S 16 G 20

Then I extract (copy) a few columns onto another sheet, with entries that look like:
=data!C216 (pointing to the column of imported data).
etc. down the column.

Then I sort those (by another column (dates)), preparing for a graph.

Then I want to separate out the two numeric entries for graphing.
My first try was using the icon for the built-in function for this, but when I run a "text-to-columns" on it, it considers the reference equation as the text, not the data that it points to.

So for example, text-to-columns of this gives me a single entry (treating the formula as a string):
| S 16 G 20 |
as it copies the formula itself and thus shows the same (original) data, when I want it to operate on the string the formula points to:
| S | 16 | G | 20 |

In any case, I prefer to split into fields using an equation, so I don’t have to automate that operation.

So instead using a splitting formula;
=TRIM(MID(SUBSTITUTE($C36," ",REPT(" ",LEN($C36))),((COLUMNS($C36:E36)-1)*LEN($C36))+1,LEN($C36)))



works fine, but for empty entries (from short fields) it puts text “” into a cell, which graphs as zero, instead of a missing data point. Converting to value by test for that, and instead put na() in the cell, instead of zero shows as connected lines on the graph, even though “show empty cells as gaps” is selected (and works, if I delete these cells they are gaps).

PS: This whole thing works fine if I just use the text-to-columns button on the original text field(!).

So guess it comes to, how do I get the splits to be empty (blank) cells for short entries, instead of (“”, or #NA)?

So I guess the simple version of the question is:
"how to split into fields, have known numerics as numbers for plotting, and have missing values be empty".
Reply With Quote
  #2  
Old 06-08-2016, 08:31 PM
xor xor is offline text-to-Fields failing - how get null for missing values? Windows 10 text-to-Fields failing - how get null for missing values? Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

When you have split into fields using your formula can't you then use a formula like the following on the values:

=IF(split_value<>"", split_value, NA())
Reply With Quote
  #3  
Old 06-08-2016, 08:48 PM
guthrie guthrie is offline text-to-Fields failing - how get null for missing values? Windows 7 64bit text-to-Fields failing - how get null for missing values? Office 2010 64bit
Novice
text-to-Fields failing - how get null for missing values?
 
Join Date: Mar 2011
Posts: 10
guthrie is on a distinguished road
Default test fot null? use NA()?

Yes, I did that, but the na() values are not treated as missing values in the plot, even though that option (show empty cells as gaps) is selected.
Manually deleting these resulting NA fields, and the plot is correct.

Seems like only missing (empty) cells will plot as gaps, and formulae are able to produce blank or NA results, not empty.

I used this:

Quote:
=IF(
TRIM(MID(SUBSTITUTE($C25," ",REPT(" ",LEN($C25))),((COLUMNS($C25:F25)-1)*LEN($C25))+1,LEN($C25)))="",
NA(),
VALUE(TRIM(MID(SUBSTITUTE($C25," ",REPT(" ",LEN($C25))),((COLUMNS($C25:F25)-1)*LEN($C25))+1,LEN($C25)))))
Reply With Quote
  #4  
Old 06-08-2016, 10:21 PM
xor xor is offline text-to-Fields failing - how get null for missing values? Windows 10 text-to-Fields failing - how get null for missing values? Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

I can't replicate that problem.
Is it possible that you can upload the file?
Reply With Quote
  #5  
Old 06-09-2016, 05:28 AM
guthrie guthrie is offline text-to-Fields failing - how get null for missing values? Windows 7 64bit text-to-Fields failing - how get null for missing values? Office 2010 64bit
Novice
text-to-Fields failing - how get null for missing values?
 
Join Date: Mar 2011
Posts: 10
guthrie is on a distinguished road
Default

Yes; attached.

As noted above, I think the main issue is that plotting only offers an option for "empty cells as gaps", and after splitting the available text data I have blank or NA cells which are not shown as gaps, and don't know how to have an expression return an empty cell. So all of the attempts below fail.

Basic idea;
Tab "Data" is raw data, downloaded form web site.
tab "Weather" then copies that (Cols A:C) except reversed order.
(to get dates forward order.)

Weather!C20:C234 is the copied data of interest.
It can be:
D nn (Direction, value)
D nn G nn (Direction, value, G, value)
Calm
then cols D:F are the split out values, which are plotted.

I left in a few experiments, trying to adjust the text values from the trim(....) expression.

One was to value() it (fails for blank), another to test for "" and NA() if found,
Another to add 0 to the text value to make it numeric (which fails if blank), then adding iferror() to adjust for those failures (but still needed to return something, and can't make an empty cell).
Attached Files
File Type: xlsm weatherData.xlsm (71.2 KB, 7 views)
Reply With Quote
  #6  
Old 06-09-2016, 08:24 AM
xor xor is offline text-to-Fields failing - how get null for missing values? Windows 10 text-to-Fields failing - how get null for missing values? Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

I don't know if this is of any help, but I have no other idea.
Attached Files
File Type: xlsm weatherData_2.xlsm (67.5 KB, 8 views)
Reply With Quote
  #7  
Old 06-09-2016, 09:33 AM
guthrie guthrie is offline text-to-Fields failing - how get null for missing values? Windows 7 64bit text-to-Fields failing - how get null for missing values? Office 2010 64bit
Novice
text-to-Fields failing - how get null for missing values?
 
Join Date: Mar 2011
Posts: 10
guthrie is on a distinguished road
Default

Thanks.

I think my analysis is correct, excel formulae cannot return empty (Hello MSoft, please add an empty() function!), so one has to use VBA.

I guess there is actually some logic to this, in that making the cell empty, would also erase the formula!

One solution is to have a second copied version of the data, but only copy if blank, and clear the copy destinations first (requires a macro or VBA). What a messy situation for a simple goal!

A better solution is for MSoft to allow for other missing values in graphs.
Reply With Quote
  #8  
Old 06-09-2016, 10:59 AM
xor xor is offline text-to-Fields failing - how get null for missing values? Windows 10 text-to-Fields failing - how get null for missing values? Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Maybe this can be of some help.

http://www.andypope.info/charts/brokenlines.htm
Reply With Quote
  #9  
Old 06-09-2016, 08:36 PM
guthrie guthrie is offline text-to-Fields failing - how get null for missing values? Windows 7 64bit text-to-Fields failing - how get null for missing values? Office 2010 64bit
Novice
text-to-Fields failing - how get null for missing values?
 
Join Date: Mar 2011
Posts: 10
guthrie is on a distinguished road
Default

Wow - creative - but complex, and a marginal result!

I think I'll just make a macro to build a copy of the data, but not copying NA cells.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
text-to-Fields failing - how get null for missing values? Display Null Values in Pivot as 0 lornalou Excel 2 06-02-2016 10:39 AM
text-to-Fields failing - how get null for missing values? Linking fields to pull values from one field to another KWH Word Tables 3 01-27-2016 02:25 PM
text-to-Fields failing - how get null for missing values? Displaying FORMTEXT fields when merge fields are empty or null sfkHooper Mail Merge 6 01-19-2016 04:24 PM
text-to-Fields failing - how get null for missing values? Eliminating zeros, null values and negatives in a column jannie Excel 1 06-22-2011 07:03 PM
Fields controlled by List box values farfromapro Word 0 02-11-2009 02:19 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:09 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft