Raury Posted April 23, 2014 Posted April 23, 2014 Hi, I have a spreadsheet of data with top depths only for a number of layers. The spreadsheet is structured as follows (only Layer_name and Top_Depth columns): [TABLE=class: grid, width: 500, align: left] [TR] [TD]Layer_name[/TD] [TD]Top_Depth[/TD] [TD]BottomDepth[/TD] [/TR] [TR] [TD]T-layer[/TD] [TD]3105.26[/TD] [TD]3127.21[/TD] [/TR] [TR] [TD]T-layer[/TD] [TD]3127.21[/TD] [TD]3135.31[/TD] [/TR] [TR] [TD]T-layer[/TD] [TD]3135.31[/TD] [TD]3135.31[/TD] [/TR] [TR] [TD]V-layer[/TD] [TD]3012[/TD] [TD]3030.8[/TD] [/TR] [TR] [TD]V-layer[/TD] [TD]3030.8[/TD] [TD]3101[/TD] [/TR] [TR] [TD]V-layer[/TD] [TD]3101[/TD] [TD]3108.2[/TD] [/TR] [TR] [TD]V-layer[/TD] [TD]3108.2[/TD] [TD]3112.6[/TD] [/TR] [TR] [TD]V-layer[/TD] [TD]3112.6[/TD] [TD]3112.6[/TD] [/TR] [TR] [TD]Y-layer[/TD] [TD]3305[/TD] [TD]3305.9[/TD] [/TR] [TR] [TD]Y-layer[/TD] [TD]3305.9[/TD] [TD]3327.2[/TD] [/TR] [TR] [TD]Y-layer[/TD] [TD]3327.2[/TD] [TD]3331.6[/TD] [/TR] [TR] [TD]Y-layer[/TD] [TD]3331.6[/TD] [TD]3331.6[/TD] [/TR] [TR] [TD]Z-layer[/TD] [TD]2916[/TD] [TD]3014[/TD] [/TR] [TR] [TD]Z-layer[/TD] [TD]3014[/TD] [TD]3014[/TD] [/TR] [/TABLE] I would like to do the following: (desired results are shown in red in the bottom depth column) 1. Add a third column called Bottom_Depth 2. In each layer, take the top depth of the next line to be the bottom depth of the previous line 3. When it reaches the end of that layer, it will copy the top depth to the bottom depth column. 4. It then continues with part 1 and part 2 above for the next layer. How do I achieve this with a script? There are 900 layers, each layer with at least 10 lines (rows) of depths. Regards, Raury
Steve21 Posted April 23, 2014 Posted April 23, 2014 Wouldn't even bother with a script if you have it as a spreadsheet etc Just use an if statement =IF(C5=C6,D6,D5) etc. Like that right? Steve
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now