Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Werf Nort
 
Posts: n/a
Default How can I use DGET in Excel with criteria that changes each line?

I want to use Excel to work between two worksheets to pull out a value from
one and stick it in the other. I tried using DGET but am I having trouble
because of the Criteria syntax. I want to use the first three columns as
criteria to fill in the third. Below is a very basic example - I'm talking
about doing this with thousands of lines of Excel data! I'm not sure if I
should be using DGET or something else, but it needs to pull the "weight"
from the second worksheet and put it in the appropriate row in the first
worksheet . . . PLEASE HELP!

Worksheet 1
Name Age Sex Weight
Alex 10 M
Corey 10 M
Elvis 9 M


Worksheet 2
Name Age Sex Weight
Alex 10 M 100
Alex 12 M 130
Brian 11 M 123
Corey 10 M 98
Dan 10 M 109
Elvis 9 M 96

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default How can I use DGET in Excel with criteria that changes each line?

Hi!

If there are possible duplicates this might be a problem.

Assume Sheet1:

Names in column A, A2:A100
Age in column B, B2:B100
Sex in column C, C2:C100

Same setup in Sheet2 and weight is in column D,D2:D100

Enter this formula in sheet1 D2:

=SUMPRODUCT(--(Sheet2!A$2:A$100=A$2),--(Sheet2!B$2:B$100=B$2),--(Sheet2!C$2:C$100=C$2),Sheet2!D$2:D$100)

Copy down as needed.

Biff

"Werf Nort" <Werf wrote in message
...
I want to use Excel to work between two worksheets to pull out a value from
one and stick it in the other. I tried using DGET but am I having trouble
because of the Criteria syntax. I want to use the first three columns as
criteria to fill in the third. Below is a very basic example - I'm
talking
about doing this with thousands of lines of Excel data! I'm not sure if I
should be using DGET or something else, but it needs to pull the "weight"
from the second worksheet and put it in the appropriate row in the first
worksheet . . . PLEASE HELP!

Worksheet 1
Name Age Sex Weight
Alex 10 M
Corey 10 M
Elvis 9 M


Worksheet 2
Name Age Sex Weight
Alex 10 M 100
Alex 12 M 130
Brian 11 M 123
Corey 10 M 98
Dan 10 M 109
Elvis 9 M 96



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default How can I use DGET in Excel with criteria that changes each line?

Ooops!

Better make the criteria row references relative:

=SUMPRODUCT(--(Sheet2!A$2:A$100=A2),--(Sheet2!B$2:B$100=B2),--(Sheet2!C$2:C$100=C2),Sheet2!D$2:D$100)


Biff

"Biff" wrote in message
...
Hi!

If there are possible duplicates this might be a problem.

Assume Sheet1:

Names in column A, A2:A100
Age in column B, B2:B100
Sex in column C, C2:C100

Same setup in Sheet2 and weight is in column D,D2:D100

Enter this formula in sheet1 D2:

=SUMPRODUCT(--(Sheet2!A$2:A$100=A$2),--(Sheet2!B$2:B$100=B$2),--(Sheet2!C$2:C$100=C$2),Sheet2!D$2:D$100)

Copy down as needed.

Biff

"Werf Nort" <Werf wrote in message
...
I want to use Excel to work between two worksheets to pull out a value
from
one and stick it in the other. I tried using DGET but am I having
trouble
because of the Criteria syntax. I want to use the first three columns
as
criteria to fill in the third. Below is a very basic example - I'm
talking
about doing this with thousands of lines of Excel data! I'm not sure if
I
should be using DGET or something else, but it needs to pull the "weight"
from the second worksheet and put it in the appropriate row in the first
worksheet . . . PLEASE HELP!

Worksheet 1
Name Age Sex Weight
Alex 10 M
Corey 10 M
Elvis 9 M


Worksheet 2
Name Age Sex Weight
Alex 10 M 100
Alex 12 M 130
Brian 11 M 123
Corey 10 M 98
Dan 10 M 109
Elvis 9 M 96





  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default How can I use DGET in Excel with criteria that changes each line?

Don't think DGET is the best way to go,


=INDEX(Sheet2!$D$4:$D$1000,MATCH(1,(Sheet2!$A$4:$A $1000=A3)*(Sheet2!$B$4:$B$1000=B3)*(Sheet2!$C$4:$C $1000=C3),0))


where Sheet2A4:D1000 is the database with weight in D4:D1000, names in
A4:A1000 and so on
Alex in your example is in A3

entered with ctrl + shift & enter then copied down will return

100
98
96


--
Regards,

Peo Sjoblom

Portland, Oregon




"Werf Nort" <Werf wrote in message
...
I want to use Excel to work between two worksheets to pull out a value from
one and stick it in the other. I tried using DGET but am I having trouble
because of the Criteria syntax. I want to use the first three columns as
criteria to fill in the third. Below is a very basic example - I'm
talking
about doing this with thousands of lines of Excel data! I'm not sure if I
should be using DGET or something else, but it needs to pull the "weight"
from the second worksheet and put it in the appropriate row in the first
worksheet . . . PLEASE HELP!

Worksheet 1
Name Age Sex Weight
Alex 10 M
Corey 10 M
Elvis 9 M


Worksheet 2
Name Age Sex Weight
Alex 10 M 100
Alex 12 M 130
Brian 11 M 123
Corey 10 M 98
Dan 10 M 109
Elvis 9 M 96


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Werf Nort
 
Posts: n/a
Default How can I use DGET in Excel with criteria that changes each line?

Thanks both of you!
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
how to change line spacing for text box in excel chart Anne Charts and Charting in Excel 1 October 5th 05 12:11 AM
How do I get a value of a calculated point on an excel line chart? klc6778 Charts and Charting in Excel 3 September 26th 05 02:17 AM
Get excel 2005 to line up damn dollar signs properly. Idiots. DGWeeks Excel Discussion (Misc queries) 1 September 15th 05 06:51 AM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM


All times are GMT +1. The time now is 04:26 AM.

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"