LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Biff
 
Posts: n/a
Default

Hi!

If you want to extract data that falls within a date range .....

DATE COUNTRY DATA
10/04/05 Syria xxxx
15/05/05 Kuwait xxxx
21/04/05 Yemen xxxx
12/05/05 Oman xxxx
04/04/05 Syria xxxx


Assume that table is in the range A1:C6

Use cells D1:E1 to hold your date range:

D1 = 4/1/2005 (using date format of mm/dd/yyyy)
E1 = 4/30/2005

Formula entered as an array with the key combo of CTRL,SHIFT,ENTER

=INDEX(A$2:A$6,SMALL(IF(($A$2:$A$6=$D$1)*($A$2:$A $6<=$E$1),ROW($1:$5)),ROW(1:1)))

Copy across then down:

10/04/05 Syria xxxx
21/04/05 Yemen xxxx
04/04/05 Syria xxxx
#NUM! #NUM! #NUM!

#NUM! means no more matching data is available.

If you want to extract data that falls within a date range and is specific
to one or more other criteria such as country:

With the same basic setup as above with the addition of the country names in
F1 and F2....

D1 = 4/1/2005 (using date format of mm/dd/yyyy)
E1 = 4/30/2005
F1 = Syria
F2 = Yemen

Array entered:

=INDEX(A$2:A$6,SMALL(IF(($A$2:$A$6=$D$1)*($A$2:$A $6<=$E$1)*($B$2:$B$6=$F$1)+($B$2:$B$6=$F$2),ROW($1 :$5)),ROW(1:1)))

Returns the same table as above.

Biff

"MelbTim" wrote in
message ...

Hello,

I need to extract data from a spreadsheet (eg below) to another
spreadsheet without using the database capabilities in Excel...which
probably means using functions/formulas. Whilst it's easy to get the
data into the second spreadsheet I end up with lots of blank lines
where the unwanted records were located in the first spreadsheet. How
do I get around this?

Eg of data in first spreadsheet:

DATE COUNTRY DATA
10/04/05 Syria xxxx
15/05/05 Kuwait xxxx
21/04/05 Yemen xxxx
12/05/05 Oman xxxx
04/04/05 Syria xxxx

I need to be able to specify a date range and extract particular
countries within those dates. For example between 01/04/05-30/04/05 I
want the data with Yemen and Syria so that the output in the second
spreadsheet looks like:

10/04/05 Syria xxxx
21/04/05 Yemen xxxx
04/04/05 Syria xxxx

Any suggestions would be hugely appreciated.

Regards

Tim


--
MelbTim
------------------------------------------------------------------------
MelbTim's Profile:
http://www.excelforum.com/member.php...o&userid=23847
View this thread: http://www.excelforum.com/showthread...hreadid=374966



 
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
Removing blank rows in a worksheet Louise Excel Worksheet Functions 6 May 26th 05 02:21 PM
How do I increase all data in database by 5% Bluejeans Excel Discussion (Misc queries) 2 April 26th 05 06:10 PM
ENTER A FORMULA IN A CELL TO UTILIZE THE IMPORT DATA FUNCTIONS? datachall Excel Worksheet Functions 2 April 26th 05 10:47 AM
Excel error while trying to import data from an Access database - MSQRY32.exe has generated errors X_HOBBES Excel Discussion (Misc queries) 0 March 15th 05 06:46 PM
Re-entering data into a Database Scribner Excel Discussion (Misc queries) 0 March 2nd 05 04:17 AM


All times are GMT +1. The time now is 02:46 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"