Two Condition Vlookup?

I am currently trying to create a function that searches through an
array for two exact column values which allows me to retrieve a third
column value.  For example:

Type of Fruit           Date Packaged             Amount of Fruit
Apples                   June                             100
Oranges                 June                             50
Apples                   July                              75
Grapes                   July                              50

In this example, I would be looking to retrieve the Amount of Fruit
(Apples) that was packaged in July.  I would be putting this into
another worksheet for export formatted as such:

                Apples         Oranges                 Grapes
June         Function      Modified Function     Modified Function
July

Any recommendations or suggestions on how I could accomplish this?
Thanks.

Garth

0
11/29/2006 4:46:53 PM
excel 39879 articles. 2 followers. Follow

7 Replies
1322 Views

Similar Articles

[PageSpeed] 41

Perhaps these are the functions I should use:

http://groups.google.com/group/microsoft.public.excel/browse_thread/thread/8bd74dd65151b355/9d50f849763849d1?lnk=gst&q=vlookup+two+condition&rnum=4&hl=en#9d50f849763849d1

Let me check.

Braech wrote:
> I am currently trying to create a function that searches through an
> array for two exact column values which allows me to retrieve a third
> column value.  For example:
>
> Type of Fruit           Date Packaged             Amount of Fruit
> Apples                   June                             100
> Oranges                 June                             50
> Apples                   July                              75
> Grapes                   July                              50
>
> In this example, I would be looking to retrieve the Amount of Fruit
> (Apples) that was packaged in July.  I would be putting this into
> another worksheet for export formatted as such:
>
>                 Apples         Oranges                 Grapes
> June         Function      Modified Function     Modified Function
> July
>
> Any recommendations or suggestions on how I could accomplish this?
> Thanks.
> 
> Garth

0
11/29/2006 4:57:16 PM
Hi

Assuming source is on Sheet1 and report on sheet2, and row 1 of sheet1 
is a header row,
enter the following in Sheet2 cell B2 and copy across and down as 
required.

=SUMPRODUCT(($A$2:$A$1000=B$1)*
(TEXT($B$2:$B$1000,"mmmm")=$A2)*
($C$2:$C$1000))

Amend ranges to suit.
Also assumed entries on report sheet are text "June" etc. as shown

-- 
Regards

Roger Govier


"Braech" <garth.whitacre@gmail.com> wrote in message 
news:1164818813.337362.14470@l39g2000cwd.googlegroups.com...
>I am currently trying to create a function that searches through an
> array for two exact column values which allows me to retrieve a third
> column value.  For example:
>
> Type of Fruit           Date Packaged             Amount of Fruit
> Apples                   June                             100
> Oranges                 June                             50
> Apples                   July                              75
> Grapes                   July                              50
>
> In this example, I would be looking to retrieve the Amount of Fruit
> (Apples) that was packaged in July.  I would be putting this into
> another worksheet for export formatted as such:
>
>                Apples         Oranges                 Grapes
> June         Function      Modified Function     Modified Function
> July
>
> Any recommendations or suggestions on how I could accomplish this?
> Thanks.
>
> Garth
> 


0
roger5293 (1125)
11/29/2006 5:09:34 PM
There is an easier way than VLOOKUP
Suppose your data starts in A1 of Sheet3. Top row is:
Type of Fruit           Date Packaged             Amount of Fruit
On another sheet beginning in A1 you have
               Apples         Oranges                 Grapes         (Apples 
is in B1)
June        XXXX 
(June is an A2)
July

The function (XXXX) needed is
=SUMPRODUCT(--(Sheet3!$A$2:$A$5=B$1),--(Sheet3!$B$2:$B$5=$A2),Sheet3!$C$2:$C$5)
The use of absolute references ($) makes it possible to copy this formula. 
The more I look at the question, the more 'homeworkesk' it seems!
For explanation see
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
http://mcgimpsey.com/excel/formulae/doubleneg.html

best wishes
-- 
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Braech" <garth.whitacre@gmail.com> wrote in message 
news:1164818813.337362.14470@l39g2000cwd.googlegroups.com...
>I am currently trying to create a function that searches through an
> array for two exact column values which allows me to retrieve a third
> column value.  For example:
>
> Type of Fruit           Date Packaged             Amount of Fruit
> Apples                   June                             100
> Oranges                 June                             50
> Apples                   July                              75
> Grapes                   July                              50
>
> In this example, I would be looking to retrieve the Amount of Fruit
> (Apples) that was packaged in July.  I would be putting this into
> another worksheet for export formatted as such:
>
>                Apples         Oranges                 Grapes
> June         Function      Modified Function     Modified Function
> July
>
> Any recommendations or suggestions on how I could accomplish this?
> Thanks.
>
> Garth
> 


0
bliengme5824 (3040)
11/29/2006 5:15:56 PM
Then again, you could use a Pivot Table
-- 
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Braech" <garth.whitacre@gmail.com> wrote in message 
news:1164818813.337362.14470@l39g2000cwd.googlegroups.com...
>I am currently trying to create a function that searches through an
> array for two exact column values which allows me to retrieve a third
> column value.  For example:
>
> Type of Fruit           Date Packaged             Amount of Fruit
> Apples                   June                             100
> Oranges                 June                             50
> Apples                   July                              75
> Grapes                   July                              50
>
> In this example, I would be looking to retrieve the Amount of Fruit
> (Apples) that was packaged in July.  I would be putting this into
> another worksheet for export formatted as such:
>
>                Apples         Oranges                 Grapes
> June         Function      Modified Function     Modified Function
> July
>
> Any recommendations or suggestions on how I could accomplish this?
> Thanks.
>
> Garth
> 


0
bliengme5824 (3040)
11/29/2006 5:17:19 PM
Thanks Roger.  For some reason that darn SUM in the title of the
function kept on making me ignore investigating that function.

Garth

Roger Govier wrote:
> Hi
>
> Assuming source is on Sheet1 and report on sheet2, and row 1 of sheet1
> is a header row,
> enter the following in Sheet2 cell B2 and copy across and down as
> required.
>
> =SUMPRODUCT(($A$2:$A$1000=B$1)*
> (TEXT($B$2:$B$1000,"mmmm")=$A2)*
> ($C$2:$C$1000))
>
> Amend ranges to suit.
> Also assumed entries on report sheet are text "June" etc. as shown
>
> --
> Regards
>
> Roger Govier
>
>
> "Braech" <garth.whitacre@gmail.com> wrote in message
> news:1164818813.337362.14470@l39g2000cwd.googlegroups.com...
> >I am currently trying to create a function that searches through an
> > array for two exact column values which allows me to retrieve a third
> > column value.  For example:
> >
> > Type of Fruit           Date Packaged             Amount of Fruit
> > Apples                   June                             100
> > Oranges                 June                             50
> > Apples                   July                              75
> > Grapes                   July                              50
> >
> > In this example, I would be looking to retrieve the Amount of Fruit
> > (Apples) that was packaged in July.  I would be putting this into
> > another worksheet for export formatted as such:
> >
> >                Apples         Oranges                 Grapes
> > June         Function      Modified Function     Modified Function
> > July
> >
> > Any recommendations or suggestions on how I could accomplish this?
> > Thanks.
> >
> > Garth
> >

0
11/29/2006 5:20:06 PM
Thanks as well Bernard.  I had considered making a PivotTable, but the
function style query seems to give me a little more cell flexibility.
My knowledge on where the fields would go in the PT also throws me off
a little.

Garth

Braech wrote:
> Thanks Roger.  For some reason that darn SUM in the title of the
> function kept on making me ignore investigating that function.
>
> Garth
>
> Roger Govier wrote:
> > Hi
> >
> > Assuming source is on Sheet1 and report on sheet2, and row 1 of sheet1
> > is a header row,
> > enter the following in Sheet2 cell B2 and copy across and down as
> > required.
> >
> > =SUMPRODUCT(($A$2:$A$1000=B$1)*
> > (TEXT($B$2:$B$1000,"mmmm")=$A2)*
> > ($C$2:$C$1000))
> >
> > Amend ranges to suit.
> > Also assumed entries on report sheet are text "June" etc. as shown
> >
> > --
> > Regards
> >
> > Roger Govier
> >
> >
> > "Braech" <garth.whitacre@gmail.com> wrote in message
> > news:1164818813.337362.14470@l39g2000cwd.googlegroups.com...
> > >I am currently trying to create a function that searches through an
> > > array for two exact column values which allows me to retrieve a third
> > > column value.  For example:
> > >
> > > Type of Fruit           Date Packaged             Amount of Fruit
> > > Apples                   June                             100
> > > Oranges                 June                             50
> > > Apples                   July                              75
> > > Grapes                   July                              50
> > >
> > > In this example, I would be looking to retrieve the Amount of Fruit
> > > (Apples) that was packaged in July.  I would be putting this into
> > > another worksheet for export formatted as such:
> > >
> > >                Apples         Oranges                 Grapes
> > > June         Function      Modified Function     Modified Function
> > > July
> > >
> > > Any recommendations or suggestions on how I could accomplish this?
> > > Thanks.
> > >
> > > Garth
> > >

0
11/29/2006 5:27:55 PM
Sounds homework-esque due to the probably common nature of this query.
Would be a little late in the year for this simple of a question
though.  Trying to automate things as much as possible from some
exported data.

Braech wrote:
> Thanks as well Bernard.  I had considered making a PivotTable, but the
> function style query seems to give me a little more cell flexibility.
> My knowledge on where the fields would go in the PT also throws me off
> a little.
>
> Garth
>
> Braech wrote:
> > Thanks Roger.  For some reason that darn SUM in the title of the
> > function kept on making me ignore investigating that function.
> >
> > Garth
> >
> > Roger Govier wrote:
> > > Hi
> > >
> > > Assuming source is on Sheet1 and report on sheet2, and row 1 of sheet1
> > > is a header row,
> > > enter the following in Sheet2 cell B2 and copy across and down as
> > > required.
> > >
> > > =SUMPRODUCT(($A$2:$A$1000=B$1)*
> > > (TEXT($B$2:$B$1000,"mmmm")=$A2)*
> > > ($C$2:$C$1000))
> > >
> > > Amend ranges to suit.
> > > Also assumed entries on report sheet are text "June" etc. as shown
> > >
> > > --
> > > Regards
> > >
> > > Roger Govier
> > >
> > >
> > > "Braech" <garth.whitacre@gmail.com> wrote in message
> > > news:1164818813.337362.14470@l39g2000cwd.googlegroups.com...
> > > >I am currently trying to create a function that searches through an
> > > > array for two exact column values which allows me to retrieve a third
> > > > column value.  For example:
> > > >
> > > > Type of Fruit           Date Packaged             Amount of Fruit
> > > > Apples                   June                             100
> > > > Oranges                 June                             50
> > > > Apples                   July                              75
> > > > Grapes                   July                              50
> > > >
> > > > In this example, I would be looking to retrieve the Amount of Fruit
> > > > (Apples) that was packaged in July.  I would be putting this into
> > > > another worksheet for export formatted as such:
> > > >
> > > >                Apples         Oranges                 Grapes
> > > > June         Function      Modified Function     Modified Function
> > > > July
> > > >
> > > > Any recommendations or suggestions on how I could accomplish this?
> > > > Thanks.
> > > >
> > > > Garth
> > > >

0
11/29/2006 5:31:41 PM
Reply:

Similar Artilces:

synchiing two computers?
Is there a way to synch Outlook on two computers? I end up with some email on my laptop and some on my desktop - it would be nice if the two could be synched so that I could have all of my email on both computers. Take a look here, it may help: http://www.slipstick.com/outlook/sync.htm -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. All unsolicited mail sent to my personal account will be deleted without reading. After furious head scratching, Bill Andersen asked: | Is there a way to synch Outlook on two computers? | I end up with some...

Compare two cells in two different files and return answer
I am attempting to compare two text cells and if they both exist, I want to bring in a "yes" answer. If they don't, bring in a "no" answer. Here's an example of text. File 1 Col A Col B BRATTA ZPB_COMMON AHERNC ZPB_COMMON GENCABH ZPB_COMMON File 2 Col A Col B BRATTA ZPB_COMMON AHERNC ZPB_COMMON GENCABH So, what I want to do is say in File 1 take cells A1 and B1 compare them to File 2 and search Col A and Col B and if there is an exact mat...

Pivot table for two different data variables
I have the following table Name type Cost overhead amy C1 23 12 bob C2 129 17 cat C2 36 45 doo C2 100 32 I owuld like to create a pivot table that looks similar to: the standard pivot table. (Please ignore type for now.) name Data Total amy Sum of overhead 200 Sum of cost 12 bob Sum of overhead 130 Sum of cost 23 cat Sum of overhead 90 Sum of cost 19 doo Sum of overhead 87 Sum of cost 34 Total Sum of overhead 507 Total Sum of cost 88 But with overall total (overhead + cost) for ...

Conditional IF formula using multi-dimensional arrays
I am attempting to find a value in a 30 column (1000+ row) array that is conditioned on finding an exact value match in adjacent column and a not-to-exceed value in the same row in the 30 column array. If this were limited to single column arrays, I would not have a problem, but the issue arrises because I do not know which column the not-to-exceed value will be in so I must use the full 30 column array. Here is my formula, which I am hoping someone would be able to help me with: {=MAX(IF((BI3:BI5000=A1)*(BJ3:CM5000<=A2),BJ3:CM5000))} Thanks for your help, Your formu...

Conditional Combo Box 12-31-09
Good Afternoon, I am using Access 2003. Forgive me if this has already been asked. I am setting up an ICT database, and I have a table that contains Software ID, Hardware ID and Disc ID as well as installation date. To highlight What software has been installed on which PC and which disc was used. What I am trying to do is I have a form and subform that links software ID to Disc ID, and I am tring to create a form to enter the data into the table described above. What I would like is based on the selection made when choosing the Software (via a combo box and stored in a field...

Two IF Statements with two answers
In cell J9 I need a formula that would do the following: If G9="Yes" then F9, If G9="No" then -f9 Note: G9 has a drop down list with Yes, No answers. If there are no other alternatives that yes and no =IF(G9="Yes",F9,-F9) otherwise =IF(G9="Yes",F9,IF(G9="No",-F9,"") Regards, Peo Sjoblom "heater" wrote: > In cell J9 I need a formula that would do the following: > > If G9="Yes" then F9, If G9="No" then -f9 > > Note: G9 has a drop down list with Yes, No answers. > =IF(G9=&qu...

Excel Conditional sum wizard for Office XP?
Add in is listed with the program; however, I was unable to install it. I went to Microsoft Office and was unable to find it? Where can I get this add in? curt SUMIF.XLA is on the CD and should have been installed with "typical" install. If not available in Tools>Add-ins, perhaps the installation was a "custom" install and the original installer did not check the Conditional Sum Wizard. Do a file search for SUMIF.XLA Normal path is C:\Program Files\Microsoft Office\Office10\Library If can't be found, go to Control Panel>Add/remove and click on MS Office ...

COUNTIF (?) on two criteria
I have a spreadsheet that logs work activities and records team members' completion of project units. Column B records team member names. Column C has project unit status - 'pending', 'beta' or 'completed'. It's easy to set up a formula to count how many units are allocated to each team member - =COUNTIF(B1:B1000,"Joe"). But what I need to do is set up formulas to count how many units Joe has completed, or has pending or at beta, and this means assessing data in both columns - which COUNTIF won't do. This doesn't strike me as an especially...

List Conditions
I'm creating a timesheet form and want to be able to populate a list of job codes specifically by client. For example, in the "Client" Column you select Client X from a list. The "Job Code" Column would then produce the drop down list specifically related to Client X. If in the "Client" Column I selected Client Y, the "Job Code" Column would then produce the specific job codes related to Client Y. There may be a much simpler alternative- any help would be appreciated. I'm creating a timesheet form and want to be able to populate a list of ...

Two axis
Positioning the Vertical axes: I have a chart where there are two axes. The first implementation produced the two scales on the right side, one inside, the other outside the chart area. Unusual, but luckily it fits well the chart. I tried to duplicate the feat with another dataset (similar in structure) and did not even get the second scale to show right, left or center (data plotted with two different scales allright). Where is the info to control these functionalities? Tx, Pierre On Wed, 29 Oct 2003 17:48:13 +0100, pl.carry <pl.carry@wanadoo.fr> wrote= : > Positioning the Vertic...

plot two groups of numbers on one series of xy coordinates.
how to create a plot from separate x and y values. i.e. y values do not correspond to the same set of x values. example x1= 5, y1=10; x2= 8, y2=15 I can read your question 2 ways; A) you data looks like this x y 5 10 8 15 etc. Select the data and make an XY chart B) you have two sets of data x1 y1 5 10 10 12 17 15 21 20 and x2 y2 3 8 7 14 12 19 18 24 Make an XY chart of the first data series Select all the data (including headers) for second set, and use Copy Click the chart to activate it Use Edit | Paste Special .... indicate New Ser...

two variables
I have a query that asks for collcode, collcode2 and booth. On any given day an employee may be collcode or collcode2. I would like to know how many times a certain emp has been paired with another employee. So how do I ask if an employee has been collcode/collcode2 and who the other person was? I hope this question makes sense. Thanks for any help Query one: SELECT CollCode, CollCode2, Booth FROM YourTable UNION ALL SELECT CollCode2, CollCode, Booth FROM YourTable Query Two SELECT CollCode, CollCode2, Count(CollCode) AS TIMESPAIRED FROM QueryOne GROUP BY CollCode, CollCode2 IF y...

Find two PCI instance but load Init() one time
Hi all, I'm developing a stream interface driver for my PCI device under WinCE 6.0 and this driver works very well currently. Now, I got a problem when testing two the same PCI devices with my stream driver. The registry can find two PCI instances (i.e. PCI\Instance\mydrv1, PCI\ Instance\mydrv2) but system only call my XXX_init() one time. Does anyone know what the problem is? The following information is my registry setting: ================================================================== [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\mydrv] "Dll"="myd...

Comparing two lists for matches
Hi, I am trying to do the following: There are two sets of supplier lists - A List and B List. I need to compare the two lists. Source A is my master. Source B is a subset of that but has contact information for all the suppliers. Hence, my goal is to retrieve the contact information from Source B and match it to the suppliers of Source A. The above can be easliy achieved using a vlookup funtion. But the problem is that some of the supplier names in the two lists are not exact matches. Hence, vlookup does not catch it. For instance, a supplier is listed as ABC Inc. in A list and as ABC, inc....

Compare two lists of names
Can you compare two lists of names where one list is last name first and the other is first name last? try this formual: =RIGHT(TRIM(E2),LEN(E2)-FIND(" ",E2))&" "&TRIM(LEFT(TRIM(E2),FIND(" ",E2))) it will convert First name last name to last name, first name or Visa versa. then you can compare your lists. "ea" wrote: > Can you compare two lists of names where one list is last name first and the > other is first name last? ...

Two copies of all Mailboxes
Using my sbs2003 srver with exchange 2003 installed - I notice two copies of all users mail box in the list of mailboxes using outlook 2003 on the same server. When I try to close these I get an error syaing mail boxes in use. I cn not remove them. Can you tell me how to remove these so I have just on mail box visible per user? thx Kevin Cain Class TECHNOLOGY ...

How do I create a chart on two axes with two lines and a bar
I am trying to compare two final stock prices to the average volume. So, teh left axes would have the numbers for the stock prices, and the right axes would have the volume. The two stock prices would be lines using the left, and the volume a bar using the right. I can do one line and one bar, but I can't figure out two lines. Can anyone help? Forget the built in custom types. It's better to build your own. Create your chart using all the data, to produce a chart with three line series all on the primary axis. Select the Volume series, and on the Chart menu, use Chart Type to ch...

how do I display last two digits of a SSN in a separate column
I am trying to create a formula to take an existing list of 8 or 9 digit numbers and display the last two numbers in a separate column. Is this possible? Try =RIGHT(A1,2) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "katbone1" wrote: > I am trying to create a formula to take an existing list of 8 or 9 digit > numbers and display the last two numbers in a separate column. Is this > possible? Hi Use a formula =3Dright(A1, 2...

Combining Text and numbers from two cells
Hi all please help i have a cell with a number such as 6000 (a1) and another cell with a text aaa- and i would like to combine them in another cell to make aaa-6000, could somebody please help me with a formula? thanks Andrew -- koba ------------------------------------------------------------------------ koba's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=28639 View this thread: http://www.excelforum.com/showthread.php?threadid=492631 Hi! Try this: A1 = 6000 B1 = aaa =B1&"-"&A1 Biff "koba" <koba.1zwtbm_1134361504.8695...

Working with two Word Documents in Windowjs 7
I'm struggling to adjust to Windows 7 from XP. How do I reduce the size of two Word documents so I can view them "side by side" so to speak. The button that reduces the size of a document shrinks it to a tiny inch or so icon square in the corner of the screen. Is there no choice to view the entire document, reduced in size, when another document is on-screen? Many thanks! When you "restore" a window, it can be resized by dragging the sides. Or you can use the "snap" feature in Windows 7 to arrange windows; see http://windows.microsoft.com/en...

possible to chart two sets of data (4 columns) with common X & Y axes?
Is there a way to combine two sets of data with common X & Y axes on a scatter chart that lets the viewer see that there are two clusters of data (say with different point types or colors)? Here's an example: Column 1: Test session Column 2: Distance traveled under condition 1 Column 3: Travel time under condition 1 Column 4: Distance traveled under condition 2 Column 5: Travel time under condition 2 Columns 2/4 and 3/5 are the Y & X axes respectively. I want to overlay the raw data so that the clusters that emerge from condition 1 and 2 are easily seen (different colored dots fo...

Conditional Format Problem.
I have a range of 11 random numbers (but all different) in cells (A1:A11) In B2 I have a single number. I would like to Conditionally Format this cell so that if it matches any 1 of the 11 cells it would turn to Green. Any help would be greatly appreciated. Thanking you in anticipation. -- Big Rick In Conditional Formatting choose formula and enter =COUNTIF($A$1:$A$11,$B$2)>0 and set background color to green! Regards, Stefi „Big Rick” ezt írta: > I have a range of 11 random numbers (but all different) in cells (A1:A11) > > In B2 I have a single number. > I would l...

Multiplying two columns
How do I multiply column A (length) by column B (width)? All I want is a new column C (area) where the cells correspond to what I just multiplied if one were to look from left to right. A x B = C. I can do it for two numbers but not whole columns.... In (eg) C1 =A1*B1 Select C1 Point to bottom right corner until you see the plus Double click To get the sum of all A*B you can use: =SUMPRODUCT(A1:A50,B1:B50) -- Regards Norman Harker MVP (Excel) Sydney, Australia njharker@optusnet.com.au Excel and Word Function Lists (Classifications, Syntax and Arguments) available free to good homes. ...

update two tables with one form
Hi, I am creating a new database and ideally would like one form only to enter the relevant data, but that means it has to update two or more tables from that. Is that possible? Thanks Christina Yes, but you need to explain your data structure a bit. In a relational database, you can have several different types of relationships. What does your form do? If you have a form that adds customers, then it would probably just update one table. If you then want to add products to your database, that would probably be a separate form. Now, when it comes time to sell a product, you would...

conditional formatting ?
I need to have the spreadsheet I'm working on reflect if clients revenues or collections have dropped for 3 consecutive months in a row. I need to somehow flag this where executives can see when there is a downward trend. The columns that these stats are in are G & H and the way they'd set this spreadsheet up is each month goes down the spreadsheet example is: client name month/04 sales rep and so on John Doe may-04 brad $39330.00 goes down with all may stats and few lines are skipped before beginning next month and so on. John Doe june-04 brad ...