PC Review


Reply
Thread Tools Rate Thread

DataBase worksheet function

 
 
Jean-Yves
Guest
Posts: n/a
 
      31st Jan 2008
Hello,

I would like to find the equivalent XL formula for this situation:

Payrol - Name - Startdate - EndDate - Function
123 Bob 01/01/2008 31/12/2008 Coach
124 Greg 01/01/2007 31/12/2007 Coach
124 Greg 01/01/2007 31/12/2007 Coach
125 Henry 01/01/2007 31/12/2007 Coach
125 Henry 01/01/2008 31/12/2008 Supervisor

The lookup should be one in the same workbook.

SELECT Max(EndDate) FROM [Workseets(1)!DataRange] WHERE Payroll = '125'

It should return "31/12/2008" for Henry (payroll:125)

Or eventually, can I use SQL to query this workbook directly. I know how to
do it in ADO to a closed workbook,
but i never used it for a kind of lookup in the actual workbook.

Thank you in advance

Jean-Yves Tfelt


 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      31st Jan 2008

With help from Bob Phillips...
If your data is in B20:F25 then
=MAX(IF(B21:B25=125,E21:E25)) ... entered as an array formula.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Jean-Yves"
wrote in message
Hello,
I would like to find the equivalent XL formula for this situation:

Payrol - Name - Startdate - EndDate - Function
123 Bob 01/01/2008 31/12/2008 Coach
124 Greg 01/01/2007 31/12/2007 Coach
124 Greg 01/01/2007 31/12/2007 Coach
125 Henry 01/01/2007 31/12/2007 Coach
125 Henry 01/01/2008 31/12/2008 Supervisor

The lookup should be one in the same workbook.
SELECT Max(EndDate) FROM [Workseets(1)!DataRange] WHERE Payroll = '125'
It should return "31/12/2008" for Henry (payroll:125)
Or eventually, can I use SQL to query this workbook directly. I know how to
do it in ADO to a closed workbook,
but i never used it for a kind of lookup in the actual workbook.
Thank you in advance
Jean-Yves Tfelt


 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      31st Jan 2008
=MAX(IF(A2:A20=125,D220))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.
Excel will automatically enclose the formula in braces (curly brackets), do
not try to do this manually.
When editing the formula, it must again be array-entered.

Note that you cannot use a whole column in array formulae (prior to excel
2007), but must use an explicit range.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jean-Yves" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I would like to find the equivalent XL formula for this situation:
>
> Payrol - Name - Startdate - EndDate - Function
> 123 Bob 01/01/2008 31/12/2008 Coach
> 124 Greg 01/01/2007 31/12/2007 Coach
> 124 Greg 01/01/2007 31/12/2007 Coach
> 125 Henry 01/01/2007 31/12/2007 Coach
> 125 Henry 01/01/2008 31/12/2008 Supervisor
>
> The lookup should be one in the same workbook.
>
> SELECT Max(EndDate) FROM [Workseets(1)!DataRange] WHERE Payroll = '125'
>
> It should return "31/12/2008" for Henry (payroll:125)
>
> Or eventually, can I use SQL to query this workbook directly. I know how
> to do it in ADO to a closed workbook,
> but i never used it for a kind of lookup in the actual workbook.
>
> Thank you in advance
>
> Jean-Yves Tfelt
>
>



 
Reply With Quote
 
Jean-Yves
Guest
Posts: n/a
 
      31st Jan 2008
Hello Jim,

I will giive a go asap and keep you informed
Thank you
Regards
JY

"Jim Cone" <(E-Mail Removed)> wrote in message
news:e%(E-Mail Removed)...
>
> With help from Bob Phillips...
> If your data is in B20:F25 then
> =MAX(IF(B21:B25=125,E21:E25)) ... entered as an array formula.
> --
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins / Excel Programming)
>
>
>
> "Jean-Yves"
> wrote in message
> Hello,
> I would like to find the equivalent XL formula for this situation:
>
> Payrol - Name - Startdate - EndDate - Function
> 123 Bob 01/01/2008 31/12/2008 Coach
> 124 Greg 01/01/2007 31/12/2007 Coach
> 124 Greg 01/01/2007 31/12/2007 Coach
> 125 Henry 01/01/2007 31/12/2007 Coach
> 125 Henry 01/01/2008 31/12/2008 Supervisor
>
> The lookup should be one in the same workbook.
> SELECT Max(EndDate) FROM [Workseets(1)!DataRange] WHERE Payroll = '125'
> It should return "31/12/2008" for Henry (payroll:125)
> Or eventually, can I use SQL to query this workbook directly. I know how
> to
> do it in ADO to a closed workbook,
> but i never used it for a kind of lookup in the actual workbook.
> Thank you in advance
> Jean-Yves Tfelt
>
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      31st Jan 2008
What? Before I had even posted <g>

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jim Cone" <(E-Mail Removed)> wrote in message
news:e%(E-Mail Removed)...
>
> With help from Bob Phillips...
> If your data is in B20:F25 then
> =MAX(IF(B21:B25=125,E21:E25)) ... entered as an array formula.
> --
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins / Excel Programming)
>
>
>
> "Jean-Yves"
> wrote in message
> Hello,
> I would like to find the equivalent XL formula for this situation:
>
> Payrol - Name - Startdate - EndDate - Function
> 123 Bob 01/01/2008 31/12/2008 Coach
> 124 Greg 01/01/2007 31/12/2007 Coach
> 124 Greg 01/01/2007 31/12/2007 Coach
> 125 Henry 01/01/2007 31/12/2007 Coach
> 125 Henry 01/01/2008 31/12/2008 Supervisor
>
> The lookup should be one in the same workbook.
> SELECT Max(EndDate) FROM [Workseets(1)!DataRange] WHERE Payroll = '125'
> It should return "31/12/2008" for Henry (payroll:125)
> Or eventually, can I use SQL to query this workbook directly. I know how
> to
> do it in ADO to a closed workbook,
> but i never used it for a kind of lookup in the actual workbook.
> Thank you in advance
> Jean-Yves Tfelt
>
>



 
Reply With Quote
 
Jim Cone
Guest
Posts: n/a
 
      31st Jan 2008

Bob,
You have to keep checking your back, they might be gaining on you <g>
(you have other earlier posts)
Regards,
Jim Cone



"Bob Phillips"
wrote in message
What? Before I had even posted <g>
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Jim Cone"
wrote in message
> With help from Bob Phillips...
> If your data is in B20:F25 then
> =MAX(IF(B21:B25=125,E21:E25)) ... entered as an array formula.
> --
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
> (Excel Add-ins / Excel Programming)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a worksheet function from another worksheet in same workbo Liz Microsoft Excel Programming 5 23rd Jun 2008 06:16 PM
Reference the worksheet from a multiple worksheet range function ( =?Utf-8?B?REJpY2tlbA==?= Microsoft Excel Worksheet Functions 1 28th May 2005 03:49 AM
Can the offset worksheet function reference another worksheet =?Utf-8?B?QWxpc3RhaXJK?= Microsoft Excel Worksheet Functions 2 9th May 2005 06:18 PM
formula/function to copy from worksheet to worksheet =?Utf-8?B?SmVu?= Microsoft Excel Programming 5 11th Jan 2005 08:22 PM
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet Ant Waters Microsoft Excel Programming 1 3rd Sep 2003 11:34 AM


Features
 

Advertising
 

Newsgroups
 


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