Convert Excel Raster into Shapefile - excel

I have an excel table in which each cell represents (NOT CONTAINS) a coordinate-pair and a value. For example Sheet 1:Cell A1 contains an X-coordinate which increases 25m downwards; Sheet 2: Cell A1 contains a Y-Coordinate which increases along; and Sheet 3: Cell A1 contains a value. Thus in effect, this is a Raster file made up of 3 Excel data sheets with a resolution of 25m with Sheet 1 representing the X-Axis, Sheet 2 the Y-Axis and sheet 3 a value within the cell.
Table structure excerpt - 200 Columns / 2000 Rows
Table "XCoord"
3544399.00 | 3544399.25 | 3544399.50 | 3544399.75 | 3544340.00 | ...etc
3544231.00 | 3544231.25 | 3544231.50 | 3544231.75 | 3544232.00 | ...etc
3544135.00 | 3544135.25 | 3544135.50 | 3544135.75 | 3544136.00 | ...etc
Table "YCoord"
584449.00 | 584449.25 | 584449.50 | 584449.75 | 584449.00 | ...etc
584431.00 | 5844431.25 | 584431.50 | 584431.75 | 584431.00 | ...etc
584429.00 | 584429.25 | 584429.50 | 584429.75 | 584429.00 | ...etc
Table "Concentration"
0.0023 | 0.0025 | 0.0020 | 0.0027 | 0.0066 | ...etc
0.0011 | 0.0034 | 0.0056 | 0.0078 | 0.0033 | ...etc
0.0016 | 0.0026 | 0.0046 | 0.0003 | 0.0005 | ...etc
So you see, for the cells - the xcoord the ycoord and the concentration can be determined.
This is a raster built with 3 tables. My problem is how to map this into a GIS application. The values in the Table "concentration" are derivitives calculated out of other tables which include the plume-dispersion parameters. So in effect, this worksheet is a very ingenious way of calculating plumes without using expensive plume modelling software. I am using ArcGIS Advanced (Info), Safe fme, Excel.
I have to convert this into a raster image or point feature class. Does anyone know how I could translate this data out of excel?
Thanks for any tips,
RB

I'm not sure what you've tried so far and what other technology's available to you, but there are many examples on the internet of using Excel + VBA to generate shapefiles, or using other programming languages like Python.
You may want to take a look at the Geographic Information Systems Stack Exchange site - there are some good examples there of how to interface between Excel and common GIS tools, for example, "How can I convert an Excel file with X and Y columns to a shapefile". The basic info is there, you'll just need to adjust your specific code to work for having data across sheets instead of down rows.
If you wanted to convert your sheets data to a single sheet with x, y, data columns, you could write a VBA script to loop over each cell in the first sheet and extract the data from the same address on the other sheets.
To get a more specific answer, you'll need to post a more specific question regarding what method you're trying to do, and what part you need help on.

Related

Function that enumerates based on data in other column

My question is inspired by this video: https://www.youtube.com/shorts/JZewxiKFplk
An Excel Table with data of names (and other data in adjacent columns irrelevant to this question). The Excel Table has data at different rows and there can be blanks arbitrarily in the table.
Like the SEQUENCE function featured in youtube video above, I am looking for a function that will generate in the column left of the Excel Table numbering for each row of data contained in the Excel Table. But unlike the youtube video above, the numbering should skip rows where there is no data, and continue its consecutive numbering for each row that contains data.
In the example below, left of "John" would be 1, left of "Mary" would be 2, and left of "Tom" would be 3. I'm not looking for a solution that would require I enter an Excel formula at every row of the Excel Table. I'm looking for a single formula like what's featured in the youtube video above. The formula should also be non-volatile.
Does a solution exist? As a last resort, if no Excel formula can do this, would a VBA solution work? The Excel Table will change size depending on the amount of data. Thank you very much for your help.
Example Excel Table of Data
| Name |
| -------- |
| |
| John |
| |
| Mary |
| |
| |
| |
| Tom |
| |
| |
Assuming your names are in B2:B20:
=LET(ζ,B2:B20,IF(ζ="","",SCAN(0,ζ,LAMBDA(α,β,α+(β<>"")))))

How to dynamically create or populate a worksheet with multiple rows, from a date range in a single row in another table

Given an existing excel TABLE with two date columns, representing the start date and end date. I would like to expand that table into a second excel TABLE in a different worksheet, so that there is one row for each of the dates between start and end. So for each row in the source table, add one row (in the target worksheet) for each date between start and end.
SOURCE TABLE:
|------------|------------|------------|------------|
|Person |Fruit |Start |End |
|------------|------------|------------|------------|
|Bob |Apple | 01/07/2019 | 04/07/2019 |
|Anna |Orange | 03/07/2019 | 05/07/2019 |
|------------|------------|------------|------------|
TARGET TABLE:
|------------|------------|------------|
|Date |Person |Fruit |
|------------|------------|------------|
| 01/04/2019 | Bob | Apple |
| 02/04/2019 | Bob | Apple |
| 03/04/2019 | Bob | Apple |
| 04/04/2019 | Bob | Apple |
| 03/04/2019 | Anna | Orange |
| 04/04/2019 | Anna | Orange |
| 05/04/2019 | Anna | Orange |
|------------|------------|------------|
A simple solution would create (or select) the target worksheet and generate all the rows required based on the data in the source.
An advanced solution would check the target worksheet to see if the rows already exist, and delete any that are not in the range. Note - I am adding this for the excel enthusiasts that really like to nail a solution. This is actually what I require, but I can build on the simple solution myself if required.
My motivation to do this is that Excel pivots and charting work best when there is a line of data in an excel TABLE for each item being analysed, much like how you would model the solution in a database.
For example, to chart the demand for oranges over time, a good pivot chart needs a single row for each date, rather than two dates expressing the start and end of the demand period (if that makes sense). Sure, you can do it with some indexing and cruel pivoting, but the user story for this spreadsheet makes that technique impossible. It must be generated automatically.
EDIT: Just adding that I appreciate that I can achieve this by adding a column for each date into the source table, and using Transform Data to generate the dataset. However, the design of the real world source table (rather than this example) has limitations set by the user that prevent me from doing so. I do also have a working method where I copy the source table to a temporary sheet, and then run a transform on that, but the user would like me to try to avoid doing that (ho-hum!)

List of x/y values from a table in excel

I have a table in excel that contains values in row 1 x1,x2...xn and values in column A y1,y2...yn. I need to populate column A in another spreadsheet with values "x1/y1", "x1/y2"..."xn/yn". Is there a way to do this without creating a script in VBA? Until now I was using just =Sheet1!A2&"/"Sheet1!&B1 and draging it down and right and then manualy copying results to column A but as the table grows it becomes quite troublesome.
EDIT:
Let me rephrase it so it could be more understandable my Sheet1 looks like
| x1 | x2 | ... | xn |
y1 | | | | |
y2 | | | | |
...
yn | | | | |
now I need to populate column A in Sheet2 so it would look like
x1/y1
x1/y2
...
x2/y1
x2/y2
...
xn/yn
Is it more understandable now?
You can use a couple of Index formula to do this
=IF(ROW() <= COUNTA(Sheet1!$A:$A) * COUNTA(Sheet1!$1:$1), INDEX(Sheet1!$1:$1,INT((ROW()-1)/COUNTA(Sheet1!$A:$A))+2)&"/"&INDEX(Sheet1!$A:$A,MOD(ROW()-1,COUNTA(Sheet1!$A:$A))+2),"")
Starting at Sheet2!A1 and copy down for at least the number of entries in the table. Any excess formula will show blanks.

EXCEL find the last relative maximum in a array (formula, not VBA)

I have a range containing values such as:
169.7978
168.633
168.5479
168.7819
167.7407
165.4146
165.1232
I don't need the maximum value of the range, i.e., the first cell in this example), but the last relative maximum, which in this case is the fourth cell. Is there a way to get this value without having to write a VBA macro? The formula must be general enough to work with a multiple number of maxima.
It may be a bit limited, but you may start somewhere as below.
Stated array in the OP is:
+----------+---+
| y | x |
+----------+---+
| 169.7978 | 1 |
| 168.633 | 2 |
| 168.5479 | 3 |
| 168.7819 | 4 |
| 167.7407 | 5 |
| 165.4146 | 6 |
| 165.1232 | 7 |
+----------+---+
Given this, you can find direct adjacency relative min/max with the following helper columns
Assign a Global_Rank helper column and look for y distro identical trend on both adjacent f(x) with the following formulas ( assuming your data is sorted by the x index )( formulas from Row 2 and filled down ).
RelativeMax:
=IF(AND(D2<=D1,D2<=D3),"RelativeMax","")
RelativeMin:
=IF(AND(D2>=D1,D2>=D3),"RelativeMin","")
Modify as needed. Hope this helps.
Edit:
Although...
If you're going to assume the data is ordered properly, you could also just use =IF(AND(B2>=B1,B2>=B3),"RelativeMin",IF(AND(B2<=B1,B2<=B3),"RelativeMax","")) and skip all the malarkey. This should work with multiple maxima/minima. Please report back with results from your dataset!

Isolate Rows that Contain Certain Values in One Column (Excel)

I need help with what I think is a simple Excel formula or function. I have two columns. As an easy example let's say the first column is numbers and the second column is colors:
| 1 | Red |
| 2 | Blue |
| 3 | Red |
| 4 | Red |
| 5 | Green|
| 6 | Brown|
Let's say I just wanted the rows with red in the second column and have everything else on the sheet deleted. How would I do that? To be clear, I want the values in column one to remain as well. This is how I would like it to look:
| 1 | Red |
| 3 | Red |
| 4 | Red |
It seems like it should be simple but I can't seem to find any way to do that. There are similar question on the forum but they are more complex than what I'm asking and require super long formulas. If that's what is required, I suppose that's what I'll do but just wanted to see if there was an easy way to do it as well. Thanks for the help!
You can use autofilter to filter the second column. Then select and copy the visible cells only, remove the filter, delete everything and paste what's in the clipboard.
Or do you need a dynamic solution? Then you could build a pivot table on a separate sheet. Put the desired color in the page filter and refresh the pivot table when the source data has changed.

Resources