Consolidating data via formula

M_B33

New Member
Joined
Jun 5, 2015
Messages
6
Hello all,

I am working on creating a data reduction sheet for a very large amount of data acquired through a Data Acquisition System. I have a 'Raw Data' sheet set up to quickly copy and paste over the entire DAQ file into specific columns. One thing I am recording is the flow rate through a solenoid. I want to consolidate the data in that column onto another sheet, based on when the value is =0.00 (solenoid is closed), and when there is anything else.

So say I have 2 draws for different spans of time in Column A of Sheet 1, but they are way down on say row 13,000+. I would like to organize that data so that Draw 1 shows up on Sheet 2 in Column A starting at row 2, and Draw 2 starting in B2.

I know I could pull the data over to the sheet just by using a simple =IF(Sheet1!A1=0,"",Sheet1!A1). Albeit, that will not organize the data so that it moves from the bottom of Sheet 1 to the top of Sheet 2.

Any help would be greatly appreciated. Thank you for your time!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Just so that I understand...

If th 0.00 appears in (say) A13000 on sheet 1, then on sheet 2, you want 0.00 to appear in A1, then below that (A2/A3 etc) you want to show all the data below A13000 from sheet 1 (A13001/A13002 etc)?
 
Upvote 0
On the assumption that your answer to the above will be yes...
A​
B​
C​
1​
1.00​
0​
2​
2.00​
d
3​
aa
3​
4​
bb
0​
5​
0.00​
aa
6​
dvv
7​
3.00​
0​
8​
0.00​
0​
9​
aa
0​
10​
vv
C1=INDEX(A:A,MATCH(0,A:A,0)+ROW()-1)
copied down

If that is to be on another sheet, then it becomses...
=INDEX(Sheet7!A:A,MATCH(0,Sheet7!A:A,0)+ROW()-1)
 
Upvote 0
FDibbins,

Thank you for your prompt reply, that is almost what I am trying to do, and I can probably make it work using that technique in a manner anyway. Although, the majority of the time my data will be reading 0.00, however from time to time there will be a draw taking place where I actually have data. I need to search through the column until I find any value greater than 0.00, then I would copy all of the info below that point UNTIL the data read 0.00 once more (showing that the solenoid had been shut and flow was lost).

Thanks!
 
Upvote 0
For Example:

Sheet 1 would show:
Draw Flow
0.00
.99
1.02
.89
1.05
0.00
0.00
0.00
3.12
3.02
3.15
2.98

<tbody>
</tbody>

Sheet 2 would show:
Draw 1Draw 2
.993.12
1.023.02
.893.15
1.052.98

<tbody>
</tbody>
 
Upvote 0
The following solution uses a helper column on sheet1 and a helper row on sheet2.
Additionally, I formatted the input and associated helper column in a table “Table1” with headers “Draw flow” in A1 and “Draw No” in B1.
So the solution will still work when entries are added.

Enter in Sheet1!B2 and copy down (will be done automatically if the range is already formatted as a table):
Code:
=(A2<>0)*(MAX(B$1:B1)+(SUM(A1)=0))
This will add sequence numbers to the input.

On Sheet2, row 1 will be a helper row with the number of values for each draw.
Enter in Sheet2!A1 and copy to the right for as many draws you would ever expect to have:
Code:
=COUNTIF(Table1[Draw No],(COLUMN(A1)-COLUMN($A1)+1))
Enter in Sheet2!A2 and copy to the right, “Draw 1”, “Draw 2”, or with a formula
Code:
=IF(A1=0,"","Draw "&( COLUMN(A1)-COLUMN($A1)+1))
Enter in Sheet2!A3, copy to the right and down for as many values you would ever expect to have in a single draw, the following array formula (confirm with CTRL-SHIFT-ENTER, not just ENTER):
Code:
=IF((ROW(A3)-ROW(A$3)+1)>A$1,"",INDEX(Table1[Draw flow],SMALL(IF(Table1[Draw No]=COLUMN(A3)-COLUMN($A3)+1,ROW(INDIRECT("1:"&COUNTA(Table1[Draw No])))),ROW(A3)-ROW(A$3)+1)))
 
Upvote 0
MarcelBeug,

Thank you for your prompt reply, I apologize for my delay in response. I just started back to working on this, and tested out your code. It works well, except for the last step. When I copy to the right it starts a count for every draw, and when I copy down it just repeats this number. So my Sheet 2 looks like:

11221116460361212132323151556
Draw 1Draw 2Draw 3Draw 4Draw 5Draw 6Draw 7Draw 8Draw 9Draw 10Draw 11Draw 12Draw 13Draw 14
1234567891011121314
1234567891011121314

<tbody>
</tbody>

So instead of it correlating with the real data from Sheet 1, it is only telling me what draw # it is. However, the top row is correct in the number of data points I have for each specific draw. So it is only this last step that I need to fix. Here is the code I had to modify it to:

=IF((ROW(A3)-ROW(A$3)+1)>A$1,"",INDEX('Raw Data'!$AN$12:$AN$13700,SMALL(IF('Raw Data'!$AN$12:$AN$13700=COLUMN(A3)-COLUMN($A3)+1,ROW(INDIRECT("1:"&COUNTA('Raw Data'!$AN$12:$AN$13700)))),ROW(A3)-ROW(A$3)+1)))

The only change is that instead of using the table format, the helper column on Sheet 1 ('Raw Data') is column AN with values starting on Row 12 going through 13700. Thanks for your help with this, I really appreciate it!!
 
Upvote 0
Ah I actually just noticed a mistake I made when I was looking closer at the code. It makes sense now why I was not seeing any flows, because I was referencing my helper column on Sheet 1 twice by mistake in the last line of code. I will modify that and let you know if it fixes everything.
 
Upvote 0
Victory! It worked like a charm after that small change. Thank you again for your assistance!
 
Upvote 0

Forum statistics

Threads
1,215,093
Messages
6,123,068
Members
449,091
Latest member
remmuS24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top