Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Get a value from a list (Database) aka DGet

Hi folks,

I have a flat table with 3 columns
Name Time Value
-------------------------
John 0:30 7
Peter 0:40 8
Joe 0:50 1
John 1:30 88

Can I use somehow a function in order to get f.ex. the value for John,
i.e.
=F(Value,Peter,0:40)
DGet has similar functionality, but the criteria expression a column
containing a range

It seems I need something like GetPivotData, but I don't have a Pivot table.
Of course I can build one and get my values, but it seems not the right
solution
I have another solution also - to concatenate the first 2 columns and later
on to use SumIf, where the range will be the concatenated column and the
criteria will be concatenation of my 2 fields..

Is there any other more elegant solution?

Thanks,
Yakimoto


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Get a value from a list (Database) aka DGet

You can use SumProduct:

=SUMPRODUCT(($A$2:$A$5=$F2)*($B$2:$B$5=G$1)*($C$2: $C$5))

where F2=John and G1=0:30

Yakimo wrote:
Hi folks,

I have a flat table with 3 columns
Name Time Value
-------------------------
John 0:30 7
Peter 0:40 8
Joe 0:50 1
John 1:30 88

Can I use somehow a function in order to get f.ex. the value for John,
i.e.
=F(Value,Peter,0:40)
DGet has similar functionality, but the criteria expression a column
containing a range

It seems I need something like GetPivotData, but I don't have a Pivot table.
Of course I can build one and get my values, but it seems not the right
solution
I have another solution also - to concatenate the first 2 columns and later
on to use SumIf, where the range will be the concatenated column and the
criteria will be concatenation of my 2 fields..

Is there any other more elegant solution?

Thanks,
Yakimoto




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Get a value from a list (Database) aka DGet

thanks, Debra

that is what i needed
yakimoto

"Debra Dalgleish" wrote in message
...
You can use SumProduct:

=SUMPRODUCT(($A$2:$A$5=$F2)*($B$2:$B$5=G$1)*($C$2: $C$5))

where F2=John and G1=0:30

Yakimo wrote:
Hi folks,

I have a flat table with 3 columns
Name Time Value
-------------------------
John 0:30 7
Peter 0:40 8
Joe 0:50 1
John 1:30 88

Can I use somehow a function in order to get f.ex. the value for John,
i.e.
=F(Value,Peter,0:40)
DGet has similar functionality, but the criteria expression a column
containing a range

It seems I need something like GetPivotData, but I don't have a Pivot

table.
Of course I can build one and get my values, but it seems not the right
solution
I have another solution also - to concatenate the first 2 columns and

later
on to use SumIf, where the range will be the concatenated column and the
criteria will be concatenation of my 2 fields..

Is there any other more elegant solution?

Thanks,
Yakimoto




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Get a value from a list (Database) aka DGet

Debra, your solution is perfect for me, when I deal with numbers in Value
column.
Do you know how I can do the same when my value is not a number, but a
string?
Example
John 0:30 Food

=func("John","0:30")
I expect to return "Food"

Thanks,
Yakimo

"Debra Dalgleish" wrote in message
...
You can use SumProduct:

=SUMPRODUCT(($A$2:$A$5=$F2)*($B$2:$B$5=G$1)*($C$2: $C$5))

where F2=John and G1=0:30

Yakimo wrote:
Hi folks,

I have a flat table with 3 columns
Name Time Value
-------------------------
John 0:30 7
Peter 0:40 8
Joe 0:50 1
John 1:30 88

Can I use somehow a function in order to get f.ex. the value for John,
i.e.
=F(Value,Peter,0:40)
DGet has similar functionality, but the criteria expression a column
containing a range

It seems I need something like GetPivotData, but I don't have a Pivot

table.
Of course I can build one and get my values, but it seems not the right
solution
I have another solution also - to concatenate the first 2 columns and

later
on to use SumIf, where the range will be the concatenated column and the
criteria will be concatenation of my 2 fields..

Is there any other more elegant solution?

Thanks,
Yakimoto




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



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
DGET only limited to 1000 Rows, but I need 8000 rows for DGET funt Chiann Looker Excel Worksheet Functions 1 March 9th 10 02:36 AM
getting a list from a database WAN Excel Discussion (Misc queries) 1 August 11th 09 11:53 AM
drop down list from database irene c Excel Discussion (Misc queries) 6 February 2nd 07 01:26 AM
database list gtsch Excel Discussion (Misc queries) 6 December 14th 05 06:18 PM
extend list or database Tiffany Krueger Excel Programming 0 October 24th 03 04:41 AM


All times are GMT +1. The time now is 07:49 AM.

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"