#1   Report Post  
Posted to microsoft.public.excel.misc
RaY RaY is offline
external usenet poster
 
Posts: 164
Default Binning Program

I have profile data that I need to group into bins of one meter. Each
profile is going to be a variable length (about 1400 measurements per file).
I would like to automate the process of binning the data. For example, the
following columns of data would be grouped according to depth where all
measurements that occur at 7 meters would be averaged together and the ones
that occur at 8 meters would be done the same way.

Depth Photons
7.831 4.82E+05
7.995 3.30E+05
8.107 4.10E+05
8.209 5.47E+05
8.372 4.26E+05
8.617 4.83E+05
8.902 4.83E+05


In a file, there are 13 columns of data. Column A is empty, Column D has
the depth and all the other columns will be averaged together based on the
depth. Each file has one worksheet. I would like the macro to put the
binned data into another worksheet in the same file.
Any help or direction would be great.
-Ray
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default Binning Program

Ray wrote:
I have profile data that I need to group into bins of one meter. Each
profile is going to be a variable length (about 1400 measurements per file).
I would like to automate the process of binning the data. For example, the
following columns of data would be grouped according to depth where all
measurements that occur at 7 meters would be averaged together and the ones
that occur at 8 meters would be done the same way.

Depth Photons
7.831 4.82E+05
7.995 3.30E+05
8.107 4.10E+05
8.209 5.47E+05
8.372 4.26E+05
8.617 4.83E+05
8.902 4.83E+05


In a file, there are 13 columns of data. Column A is empty, Column D has
the depth and all the other columns will be averaged together based on the
depth. Each file has one worksheet. I would like the macro to put the
binned data into another worksheet in the same file.
Any help or direction would be great.
-Ray


If your bins are *consecutive* integers this will work:

In a spare column, say X, place numbers 7, 8, etc.

And in Y1 this array* formula, which can be filled down as needed:
=AVERAGE(IF(INT($D$2:$D$8)=X1,$E$2:$E$8))

*Commit the array formula by pressing Ctrl+Shift+Enter, not just Enter.

To place in another worksheet just change the sheet references
accordingly, or cut and paste the example from one sheet to another.
  #3   Report Post  
Posted to microsoft.public.excel.misc
RaY RaY is offline
external usenet poster
 
Posts: 164
Default Binning Program

That's worked great. Thanks. What would the syntax be for Ctrl+Shift+Enter
so I can automate this process.

"smartin" wrote:

Ray wrote:
I have profile data that I need to group into bins of one meter. Each
profile is going to be a variable length (about 1400 measurements per file).
I would like to automate the process of binning the data. For example, the
following columns of data would be grouped according to depth where all
measurements that occur at 7 meters would be averaged together and the ones
that occur at 8 meters would be done the same way.

Depth Photons
7.831 4.82E+05
7.995 3.30E+05
8.107 4.10E+05
8.209 5.47E+05
8.372 4.26E+05
8.617 4.83E+05
8.902 4.83E+05


In a file, there are 13 columns of data. Column A is empty, Column D has
the depth and all the other columns will be averaged together based on the
depth. Each file has one worksheet. I would like the macro to put the
binned data into another worksheet in the same file.
Any help or direction would be great.
-Ray


If your bins are *consecutive* integers this will work:

In a spare column, say X, place numbers 7, 8, etc.

And in Y1 this array* formula, which can be filled down as needed:
=AVERAGE(IF(INT($D$2:$D$8)=X1,$E$2:$E$8))

*Commit the array formula by pressing Ctrl+Shift+Enter, not just Enter.

To place in another worksheet just change the sheet references
accordingly, or cut and paste the example from one sheet to another.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default Binning Program

Ah yes, you did say macro..

Something like
Cells(R,C).FormulaArray = "=AVERAGE(IF(INT($D$2:$D$8)=X1,$E$2:$E$8))"

Ray wrote:
That's worked great. Thanks. What would the syntax be for Ctrl+Shift+Enter
so I can automate this process.

"smartin" wrote:

Ray wrote:
I have profile data that I need to group into bins of one meter. Each
profile is going to be a variable length (about 1400 measurements per file).
I would like to automate the process of binning the data. For example, the
following columns of data would be grouped according to depth where all
measurements that occur at 7 meters would be averaged together and the ones
that occur at 8 meters would be done the same way.

Depth Photons
7.831 4.82E+05
7.995 3.30E+05
8.107 4.10E+05
8.209 5.47E+05
8.372 4.26E+05
8.617 4.83E+05
8.902 4.83E+05


In a file, there are 13 columns of data. Column A is empty, Column D has
the depth and all the other columns will be averaged together based on the
depth. Each file has one worksheet. I would like the macro to put the
binned data into another worksheet in the same file.
Any help or direction would be great.
-Ray

If your bins are *consecutive* integers this will work:

In a spare column, say X, place numbers 7, 8, etc.

And in Y1 this array* formula, which can be filled down as needed:
=AVERAGE(IF(INT($D$2:$D$8)=X1,$E$2:$E$8))

*Commit the array formula by pressing Ctrl+Shift+Enter, not just Enter.

To place in another worksheet just change the sheet references
accordingly, or cut and paste the example from one sheet to another.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to unload the loaded XLL file in Excel? Hi all, I amdebugging XLL link library using Visual C++. Everytime I rebuild the XLL, Ihave to close the whole Excel program and relaunch the Excel program again,and then load in the newly gene LunaMoon Excel Discussion (Misc queries) 0 July 28th 08 11:03 PM
please help in this program TheGodfather Excel Discussion (Misc queries) 0 March 4th 07 03:18 PM
Which program? Dear Sir Excel Discussion (Misc queries) 4 January 14th 07 07:27 PM
My program SM Excel Worksheet Functions 2 October 22nd 05 04:52 AM
My Program SM Charts and Charting in Excel 1 October 21st 05 09:48 PM


All times are GMT +1. The time now is 01:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"