Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default lookup lastmonth

ColA ColB
1/2/2003 ABC
1/3/2003 EEE
1/4/2003 EEE
2/5/2003 EEE
2/6/2003 ABC
2/7/2003 EEE
2/8/2003 EEE
3/10/2003 EEE
3/11/2003 EEE
3/12/2003 ABC
3/13/2003 EEE
3/14/2003 EEE
4/25/2003 ABC
4/26/2003 EEE
4/27/2003 EEE
4/28/2003 EEE
5/2/2003 ABC

If today is 5/2/2003, how the formulas or macros can be
searched the date of ABC in last month
I want the result will be

ColA ColB
4/25/2003 ABC
5/2/2003 ABC

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default lookup lastmonth

Mike

Here's a formula approach to your problem, assuming that
only one instance of ABC exists for each month (which
your example implies).

Assumptions

Data in A2:A18

In e.g. C14 enter the formula =TODAY()
In D14 enter ABC
In D15 enter =D14
In C15 enter the formula

=SUMPRODUCT((MONTH(A2:A18)=MONTH(C14)-1)*(B2:B18=D14)*A2:A18)


--
Best Regards
Leo Heuser
MVP Excel

Followup to newsgroup only, please.

"Mike" skrev i en meddelelse
...
ColA ColB
1/2/2003 ABC
1/3/2003 EEE
1/4/2003 EEE
2/5/2003 EEE
2/6/2003 ABC
2/7/2003 EEE
2/8/2003 EEE
3/10/2003 EEE
3/11/2003 EEE
3/12/2003 ABC
3/13/2003 EEE
3/14/2003 EEE
4/25/2003 ABC
4/26/2003 EEE
4/27/2003 EEE
4/28/2003 EEE
5/2/2003 ABC

If today is 5/2/2003, how the formulas or macros can be
searched the date of ABC in last month
I want the result will be

ColA ColB
4/25/2003 ABC
5/2/2003 ABC

Thanks,



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
lookup help. lookup result based on data in 2 columns lcc Excel Worksheet Functions 3 April 6th 10 01:20 PM
LOOKUP FUNCTION? (LOOKUP VALUE BEING A TIME RENERATED FROM A FORMU JCC Excel Discussion (Misc queries) 5 June 26th 09 09:15 PM
Matrix lookup/mulitple criteria lookup MarkFranklin Excel Discussion (Misc queries) 3 March 31st 08 10:15 AM
Get Cell Address From Lookup (Alternative to Lookup) ryguy7272 Excel Worksheet Functions 12 September 28th 07 10:36 PM
Join 2 Lists - Lookup value in 1 list & use result in 2nd lookup JBush Excel Worksheet Functions 3 January 3rd 07 11:14 PM


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