alanlambden
Board Regular
- Joined
- Nov 20, 2014
- Messages
- 73
Hi,
I am hoping to get some help with some excel arithmetic. This is quite a difficult issue to explain. My VBA coding is fairly rudimentary too so I was hoping to crack this problem in the cells.
I'm working with drillhole data. I have two sets of data that I need to calculate some ratios based on a column in each dataset and converge into one column.
The first is the sampling intervals. Shown here on the left. These are the interval that are sent to the lab for analysis. We happen to be analyzing rock for gold. Below you can see that from between 0-24.1m we had 12 samples. Most of them were around 2m wide, some are slightly larger and some are smaller.
The second set of data is what we call in the industry as 'recovery'. This is when we estimate how much of the rock was intact after being extracted from the ground. For example if we pull up a 1m sample and the rock is solid with no breaks, thats 100%. If the drilling intercepts a fault or a highly weathered piece, it is likely that the rock will be crumbly and less-than-intact. We use a technique to measure how much rock is there against how much should be there and assign it a percentage. So after measuring the interval and there is only 75cm of intact rock and the rest is mud/sand or whatever, that would get assigned a 75% recovery.
You can see below that there were many more recovery intervals taken than sample intervals. What I would like to do is assign each sample interval a recovery percentage, calculated from the actual recovery data. That would mean some arithmetic to adjust the ratios of each recovery interval to fit into the sample interval.
So the first sample interval 0-0.4 would be assigned 100% because the first interval in the recovery(%) data envelops this interval completely and exactly. The 0.3m that stretches into the next sample interval, must then be weighted (.3m x 100%) and added to the next recovery interval (1.2m x 45.8% - the 1.2m being the total length of the interval 1.9m - .7m). The sampling interval 0.4m - 3.4m must be satisfied with all the remaining recoveries. So then the code must also add (0.6m (because 2.5m-1.9m) X 66.6% ) and (0.5m (because 3m-2.5m) x 100%) and then the final recovery falls nicely on 3.4m so we must add (0.4m x 100%) adding all these weighted recoverys up and then divide by the sample length will give us the amalgamated recovery for the interval.....and then proceed to the next sample interval and fitting the recoveries in accordingly. Here is the arithmetic for the second interval...but I am having a lot of trouble getting excel to do this for me.
.3m x 100% = 30
1.2m x 45.8% = 55
0.6m X 66.6% = 40
0.5m x 100% = 50
0.4m x 100% = 40
30 + 55 + 40 + 50 + 40 = 215/3m = 71.7%. I want to populate the remaining cells in the 'adjusted recovery' column.
Sorry if I made it sound really complicated!
I am hoping to get some help with some excel arithmetic. This is quite a difficult issue to explain. My VBA coding is fairly rudimentary too so I was hoping to crack this problem in the cells.
I'm working with drillhole data. I have two sets of data that I need to calculate some ratios based on a column in each dataset and converge into one column.
The first is the sampling intervals. Shown here on the left. These are the interval that are sent to the lab for analysis. We happen to be analyzing rock for gold. Below you can see that from between 0-24.1m we had 12 samples. Most of them were around 2m wide, some are slightly larger and some are smaller.
The second set of data is what we call in the industry as 'recovery'. This is when we estimate how much of the rock was intact after being extracted from the ground. For example if we pull up a 1m sample and the rock is solid with no breaks, thats 100%. If the drilling intercepts a fault or a highly weathered piece, it is likely that the rock will be crumbly and less-than-intact. We use a technique to measure how much rock is there against how much should be there and assign it a percentage. So after measuring the interval and there is only 75cm of intact rock and the rest is mud/sand or whatever, that would get assigned a 75% recovery.
You can see below that there were many more recovery intervals taken than sample intervals. What I would like to do is assign each sample interval a recovery percentage, calculated from the actual recovery data. That would mean some arithmetic to adjust the ratios of each recovery interval to fit into the sample interval.
So the first sample interval 0-0.4 would be assigned 100% because the first interval in the recovery(%) data envelops this interval completely and exactly. The 0.3m that stretches into the next sample interval, must then be weighted (.3m x 100%) and added to the next recovery interval (1.2m x 45.8% - the 1.2m being the total length of the interval 1.9m - .7m). The sampling interval 0.4m - 3.4m must be satisfied with all the remaining recoveries. So then the code must also add (0.6m (because 2.5m-1.9m) X 66.6% ) and (0.5m (because 3m-2.5m) x 100%) and then the final recovery falls nicely on 3.4m so we must add (0.4m x 100%) adding all these weighted recoverys up and then divide by the sample length will give us the amalgamated recovery for the interval.....and then proceed to the next sample interval and fitting the recoveries in accordingly. Here is the arithmetic for the second interval...but I am having a lot of trouble getting excel to do this for me.
.3m x 100% = 30
1.2m x 45.8% = 55
0.6m X 66.6% = 40
0.5m x 100% = 50
0.4m x 100% = 40
30 + 55 + 40 + 50 + 40 = 215/3m = 71.7%. I want to populate the remaining cells in the 'adjusted recovery' column.
Sorry if I made it sound really complicated!
Code:
[TABLE="width: 747"]
<tbody>[TR]
[TD="colspan: 3"]Sampling intervals[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 4"]Recovery[/TD]
[/TR]
[TR]
[TD]Hole #[/TD]
[TD]From[/TD]
[TD]To[/TD]
[TD]length[/TD]
[TD="colspan: 2"]Adjusted recovery[/TD]
[TD]From[/TD]
[TD]To[/TD]
[TD]length[/TD]
[TD]Recovery (%)[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0.4[/TD]
[TD="align: right"]0.4[/TD]
[TD="align: right"]100[/TD]
[TD][/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0.7[/TD]
[TD="align: right"]0.7[/TD]
[TD="align: right"]100[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]0.4[/TD]
[TD="align: right"]3.4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]71.7[/TD]
[TD][/TD]
[TD="align: right"]0.7[/TD]
[TD="align: right"]1.9[/TD]
[TD="align: right"]1.2[/TD]
[TD="align: right"]45.8[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]3.4[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]2.6[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]1.9[/TD]
[TD="align: right"]2.5[/TD]
[TD="align: right"]0.6[/TD]
[TD="align: right"]66.7[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]8.1[/TD]
[TD="align: right"]2.1[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2.5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]0.5[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]8.1[/TD]
[TD="align: right"]10.1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3.4[/TD]
[TD="align: right"]0.4[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]10.1[/TD]
[TD="align: right"]12.1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]3.4[/TD]
[TD="align: right"]4.05[/TD]
[TD="align: right"]0.65[/TD]
[TD="align: right"]96.9[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]12.1[/TD]
[TD="align: right"]14.1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]4.05[/TD]
[TD="align: right"]4.7[/TD]
[TD="align: right"]0.65[/TD]
[TD="align: right"]53.8[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]14.1[/TD]
[TD="align: right"]16.1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]4.7[/TD]
[TD="align: right"]5.55[/TD]
[TD="align: right"]0.85[/TD]
[TD="align: right"]82.4[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]16.1[/TD]
[TD="align: right"]18.1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]5.55[/TD]
[TD="align: right"]6.4[/TD]
[TD="align: right"]0.85[/TD]
[TD="align: right"]94.1[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]18.1[/TD]
[TD="align: right"]20.1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]6.4[/TD]
[TD="align: right"]7.25[/TD]
[TD="align: right"]0.85[/TD]
[TD="align: right"]94.1[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]20.1[/TD]
[TD="align: right"]22.1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]7.25[/TD]
[TD="align: right"]8.05[/TD]
[TD="align: right"]0.8[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD]DH-001[/TD]
[TD="align: right"]22.1[/TD]
[TD="align: right"]24.1[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]8.05[/TD]
[TD="align: right"]9.2[/TD]
[TD="align: right"]1.15[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]9.2[/TD]
[TD="align: right"]10.3[/TD]
[TD="align: right"]1.1[/TD]
[TD="align: right"]90.9[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]10.3[/TD]
[TD="align: right"]11.3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]11.3[/TD]
[TD="align: right"]12.8[/TD]
[TD="align: right"]1.5[/TD]
[TD="align: right"]96.7[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]12.8[/TD]
[TD="align: right"]14.3[/TD]
[TD="align: right"]1.5[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]14.3[/TD]
[TD="align: right"]15.8[/TD]
[TD="align: right"]1.5[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]15.8[/TD]
[TD="align: right"]17.3[/TD]
[TD="align: right"]1.5[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]17.3[/TD]
[TD="align: right"]18.8[/TD]
[TD="align: right"]1.5[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]18.8[/TD]
[TD="align: right"]19.9[/TD]
[TD="align: right"]1.1[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]19.9[/TD]
[TD="align: right"]20.6[/TD]
[TD="align: right"]0.7[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]20.6[/TD]
[TD="align: right"]21.4[/TD]
[TD="align: right"]0.8[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]21.4[/TD]
[TD="align: right"]22.9[/TD]
[TD="align: right"]1.5[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]22.9[/TD]
[TD="align: right"]24.1[/TD]
[TD="align: right"]1.2[/TD]
[TD="align: right"]100.0[/TD]
[/TR]
</tbody>[/TABLE]