Hi,
I'm trying devise a formula to sum the data from the "Seconds" column whenever a "1" follows a "4" from the "Mode" column. I don't want to sum where there are "4's" or "1's" following other "1's".
Here's an example (in this case the sum would be 59):
[TABLE="width: 50, align: left"]
<tbody>[TR]
[TD]Seconds[/TD]
[TD]Mode[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]55[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]17
[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]32[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
To add to the complexity, the number of rows is variable from file to file.
One of the solutions I have right now is to implement a loop in my VBA to run through all the data record by record. But the point of this thread is to try and find another solution seeing as this has to be summed up in over 40 different daily-generated files that could contain somewhere between 200-300 records each.
Version: Excel 2007
Any ideas would be appreciated.
Thanks,
I'm trying devise a formula to sum the data from the "Seconds" column whenever a "1" follows a "4" from the "Mode" column. I don't want to sum where there are "4's" or "1's" following other "1's".
Here's an example (in this case the sum would be 59):
[TABLE="width: 50, align: left"]
<tbody>[TR]
[TD]Seconds[/TD]
[TD]Mode[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]55[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]17
[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]32[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
</tbody>[/TABLE]
To add to the complexity, the number of rows is variable from file to file.
One of the solutions I have right now is to implement a loop in my VBA to run through all the data record by record. But the point of this thread is to try and find another solution seeing as this has to be summed up in over 40 different daily-generated files that could contain somewhere between 200-300 records each.
Version: Excel 2007
Any ideas would be appreciated.
Thanks,