LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default BETTER SPACING - If Then Date Range

So, Mark, the original problem that you posted does not exactly reflect
your actual setup. What you posted is more like an effort for a digest,
where you envisioned putting all your criteria together in a 9th sheet.
Your problem is basically the following: you want to start with a
source list and then produce a destination list, which is a subset of
the first, according to arbitrary criteria, and you want the subset to
be contiguous. In this case the source list has a fixed number of
columns (as shown in your original post as Sheet2) and you want to
produce various destination lists in (necessarily?) adjacent columns.

So, I will give you a *sample* solution, formula based, which can be
adapted to suit your needs. This is based on your approach of the
original post, namely that you somehow parametrize your criteria
instead of trying to write a macro which will pull of the filtered data
only.

The following example assumes a list of numbers from 0 to 1000 in cells
A1:A20. We want to produce the subset of this list that contains
numbers less than 500. I will use two auxiliary columns: Column D:D
will compute the row numbers of where admissible numbers are and column
E:E will produce the actual data number. In both cases the destination
lists start from row 1.

Formulas in column D:D are to be array-entered (Shift+Ctrl+Enter).

In D1:
=MIN(ROW(A1:A20)*(IF(A1:A20<500, 1, 10000)))
In D2:
=MIN(ROW($A$1:$A$20)*(IF($A$1:$A$20<500, 1,
10000))*IF(ROW($A$1:$A$20)D1,1,10000))
Copy D2 down until a very large row number appears.

In E1:
=IF(D1<$D$1*10000, OFFSET($A$1,D1-1,0), "")
Copy down as necessary.

The condition is in the IF(A1:A20<500, 1, 10000) in D1 and
IF($A$1:$A$20<500, 1, 10000) in D2. You can modify the condition to
suit your needs.

Drawbacks:
- You must have enough copies of formulas down, which might make the
spreadsheet heavy in recalculation
- You need two columns per destination column. But these you can hide.

The OFFSET formula is enclosed in an IF() so as to not display 0's. The
criterion for this IF is explained as follows: $D$1 will have the first
row where data is found. This row number times 10000 is the large
number that will appear in column D:D after you run out of data.

Write back if you need more.

HTH
Kostis Vezerides

 
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
How do I get an IF statement to pull a date range?? Brooke Medvecky Excel Worksheet Functions 9 April 19th 06 08:48 PM
Date Range within one cell Cachod1 New Users to Excel 5 October 18th 05 03:30 AM
Date Range and calculation vgreen Excel Worksheet Functions 2 August 23rd 05 11:08 AM
Update cell based on date range deversole Excel Discussion (Misc queries) 3 July 6th 05 01:58 PM
Count cells based on date range in another column [email protected] New Users to Excel 1 May 5th 05 08:11 PM


All times are GMT +1. The time now is 08:10 PM.

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"