Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default automatic table to table copy

Using a formula, I need to copy a table to a table omitting rows that meet
certain criteria (like no sales). This needs to be an 'automated' task since
I have some many.

I have worksheets for each of 50 states that list each county/parish, sales,
tax, tax rates. In another section of each of those worksheets I need to
list only those counties/parishes with sales and the resulting table should
include sales, tax, & tax rate.

Can this be done?

Thanks for your help in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default automatic table to table copy

Here's a crack at automating this using non-array formulas ..

2 key functionalities are taken care of, the first being the
auto-consolidation ("stacking") of lines from all source data sheets into a
single sheet (X), then a DV selectable auto pull-out of the required "balance
lines" results from X into Y, based on the selected key col's omission value

A sample implementation is available at:
http://www.savefile.com/files/9152204
Autoconsol fr var shts n autocopy bal lines to new sht_omission basis.xls

Data is assumed in identically structured source sheets named consistently
as eg: S1, S2, S3 .. etc (numerically sequenced), within cols A to D from
row2 down, where col D = key col housing either values, eg: "Yes", "No Sales"
or nothing (Empty). Data is expected to a max of say, 10 lines per source
sheet.

In a sheet named: X,
with the same col headers pasted into A1:D1,
we can auto-"consolidate" all lines from all source sheets: S1, S2, S3 ...
by stacking the lines sequentially in the numeric order of the sheetnames:
lines from S1 first, then those from S2, then from S3, and so on ..

Put in A2:
=IF(ISERROR(INDIRECT("'S"&INT((ROW(A1)-1)/10)+1&"'!A1")),"",IF(OFFSET(INDIRECT("'S"&INT((ROW (A1)-1)/10)+1&"'!A1"),MOD(ROW(A1)-1,10)+1,COLUMN(A1)-1)=0,"",OFFSET(INDIRECT("'S"&INT((ROW(A1)-1)/10)+1&"'!A1"),MOD(ROW(A1)-1,10)+1,COLUMN(A1)-1)))

Copy A2 across to D2, fill down as far as required. Fill down to cover
sufficiently the aggregate number of rows from all the source sheets, viz.:
[assumed 10 rows per source sheet] x [# of source sheets, eg 5] = 10 x 5 = 50
rows. Change the number "10" in the formula in A2 to suit the max expected
number of lines per source sheet (we had assumed this was 10 lines per source
sheet earlier)

Then .. in another sheet: Y (say),

Create a DV droplist in D1 to allow selection of key col's value to be
omitted, ie either: No Sales or Yes. The DV is created via Data Validation
, Allow: List, Source: No Sales, Yes

Put in A2:
=IF(ROW(A1)COUNT($D:$D),"",INDEX(X!A:A,MATCH(SMAL L($D:$D,ROW(A1)),$D:$D,0)))
Copy A2 to C2

Put in D2:
=IF(OR(X!D2="",$D$1=""),"",IF(X!D2=$D$1,"",ROW()))

Then just select A2:D2 and copy down to cover the max expected extent of
data in X. Cols A to C will return the required results* dynamically from X,
depending on the omission value selected in D1, with all results neatly
bunched at the top. *only "balance" lines from X will appear viz. lines
without the value selected in D1. Adapt & extend to suit ...
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Sunny" wrote:
Using a formula, I need to copy a table to a table omitting rows that meet
certain criteria (like no sales). This needs to be an 'automated' task since
I have some many.

I have worksheets for each of 50 states that list each county/parish, sales,
tax, tax rates. In another section of each of those worksheets I need to
list only those counties/parishes with sales and the resulting table should
include sales, tax, & tax rate.

Can this be done?

Thanks for your help in advance.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default automatic table to table copy

Thank you sooooo much!

"Max" wrote:

Here's a crack at automating this using non-array formulas ..

2 key functionalities are taken care of, the first being the
auto-consolidation ("stacking") of lines from all source data sheets into a
single sheet (X), then a DV selectable auto pull-out of the required "balance
lines" results from X into Y, based on the selected key col's omission value

A sample implementation is available at:
http://www.savefile.com/files/9152204
Autoconsol fr var shts n autocopy bal lines to new sht_omission basis.xls

Data is assumed in identically structured source sheets named consistently
as eg: S1, S2, S3 .. etc (numerically sequenced), within cols A to D from
row2 down, where col D = key col housing either values, eg: "Yes", "No Sales"
or nothing (Empty). Data is expected to a max of say, 10 lines per source
sheet.

In a sheet named: X,
with the same col headers pasted into A1:D1,
we can auto-"consolidate" all lines from all source sheets: S1, S2, S3 ...
by stacking the lines sequentially in the numeric order of the sheetnames:
lines from S1 first, then those from S2, then from S3, and so on ..

Put in A2:
=IF(ISERROR(INDIRECT("'S"&INT((ROW(A1)-1)/10)+1&"'!A1")),"",IF(OFFSET(INDIRECT("'S"&INT((ROW (A1)-1)/10)+1&"'!A1"),MOD(ROW(A1)-1,10)+1,COLUMN(A1)-1)=0,"",OFFSET(INDIRECT("'S"&INT((ROW(A1)-1)/10)+1&"'!A1"),MOD(ROW(A1)-1,10)+1,COLUMN(A1)-1)))

Copy A2 across to D2, fill down as far as required. Fill down to cover
sufficiently the aggregate number of rows from all the source sheets, viz.:
[assumed 10 rows per source sheet] x [# of source sheets, eg 5] = 10 x 5 = 50
rows. Change the number "10" in the formula in A2 to suit the max expected
number of lines per source sheet (we had assumed this was 10 lines per source
sheet earlier)

Then .. in another sheet: Y (say),

Create a DV droplist in D1 to allow selection of key col's value to be
omitted, ie either: No Sales or Yes. The DV is created via Data Validation
, Allow: List, Source: No Sales, Yes

Put in A2:
=IF(ROW(A1)COUNT($D:$D),"",INDEX(X!A:A,MATCH(SMAL L($D:$D,ROW(A1)),$D:$D,0)))
Copy A2 to C2

Put in D2:
=IF(OR(X!D2="",$D$1=""),"",IF(X!D2=$D$1,"",ROW()))

Then just select A2:D2 and copy down to cover the max expected extent of
data in X. Cols A to C will return the required results* dynamically from X,
depending on the omission value selected in D1, with all results neatly
bunched at the top. *only "balance" lines from X will appear viz. lines
without the value selected in D1. Adapt & extend to suit ...
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Sunny" wrote:
Using a formula, I need to copy a table to a table omitting rows that meet
certain criteria (like no sales). This needs to be an 'automated' task since
I have some many.

I have worksheets for each of 50 states that list each county/parish, sales,
tax, tax rates. In another section of each of those worksheets I need to
list only those counties/parishes with sales and the resulting table should
include sales, tax, & tax rate.

Can this be done?

Thanks for your help in advance.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default automatic table to table copy

Welcome, Sunny !
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Sunny" wrote:
Thank you sooooo much!

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
AUTOMATIC way to copy the value of a cell in one spreadsheet Mihalis4 Excel Worksheet Functions 2 December 2nd 05 06:49 PM
Automatic copy a worksheet, bioyyy Excel Discussion (Misc queries) 10 October 16th 05 10:40 PM
How can I copy a table from a cell value? Julio Fidel. Excel Discussion (Misc queries) 0 September 8th 05 10:13 PM
automatic copy cells into other worksheet?? Matt Hall Excel Discussion (Misc queries) 2 September 8th 05 04:06 AM
Automatic Copy of Data Rags Excel Discussion (Misc queries) 8 September 1st 05 08:35 PM


All times are GMT +1. The time now is 05:58 AM.

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

About Us

"It's about Microsoft Excel"