Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Lookup multi criteria

I have two sheets. The second sheet obtains data from the first sheet. The
value (£) depends on three criteria in the same row. ie Code,Cost centre and
Department.
When all three match the value (£) is returned or if not 0.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Lookup multi criteria

Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

oscarcounts wrote:

I have two sheets. The second sheet obtains data from the first sheet. The
value (£) depends on three criteria in the same row. ie Code,Cost centre and
Department.
When all three match the value (£) is returned or if not 0.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Lookup multi criteria

Many thanks for your e-mail and formula. This is the formula that I am using
in the 2nd workbook which works when the three critreia and financial value
match. However when there is no match #N/A is returned. How can I replace the
#N/A with a 0 (zero) ?

=INDEX('[RBAS Trial balance.xls]TOTALS'!$F$2:$F$2520,MATCH(1,($A8='[RBAS
Trial balance.xls]TOTALS'!$B$2:$B$2520)*("Q02"='[RBAS Trial
balance.xls]TOTALS'!$C$2:$C$2520)*($C$3='[RBAS Trial
balance.xls]TOTALS'!$D$2:$D$2520),0))

Workbook 1. (Financial Trial balance)

Col B Codes (say 60001)
Col C Cost Centres ( say Q02)
Col D Departments ( say 801)
Col F Financial values ( say £100)

Workbook 2

The purpose is to obtain data from Col F in WB 1 when Code (col B), Cost
Centre (col C) and Dept (col D ) match. If there is no match a 0 (zero)
should be returned.

I hope this makes sense!

Kind regards.



"Dave Peterson" wrote:

Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

oscarcounts wrote:

I have two sheets. The second sheet obtains data from the first sheet. The
value (£) depends on three criteria in the same row. ie Code,Cost centre and
Department.
When all three match the value (£) is returned or if not 0.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Lookup multi criteria

If you're using xl2007, look at =iferror() in Excel's help.

If you're xl2003 or below, then you could double up the formula:
=if(isna(thatlongformula),0,thatlongformula)

Personally, I'd use a couple of columns (say B and C):
The first one is just that formula
The second one is:
=if(isna(b2),0,b2)

and I'd hide column B.

Depending on how many rows are in the table and how many formulas you're going
to use, doubling up the formulas could really slow calculations down.


oscarcounts wrote:

Many thanks for your e-mail and formula. This is the formula that I am using
in the 2nd workbook which works when the three critreia and financial value
match. However when there is no match #N/A is returned. How can I replace the
#N/A with a 0 (zero) ?

=INDEX('[RBAS Trial balance.xls]TOTALS'!$F$2:$F$2520,MATCH(1,($A8='[RBAS
Trial balance.xls]TOTALS'!$B$2:$B$2520)*("Q02"='[RBAS Trial
balance.xls]TOTALS'!$C$2:$C$2520)*($C$3='[RBAS Trial
balance.xls]TOTALS'!$D$2:$D$2520),0))

Workbook 1. (Financial Trial balance)

Col B Codes (say 60001)
Col C Cost Centres ( say Q02)
Col D Departments ( say 801)
Col F Financial values ( say £100)

Workbook 2

The purpose is to obtain data from Col F in WB 1 when Code (col B), Cost
Centre (col C) and Dept (col D ) match. If there is no match a 0 (zero)
should be returned.

I hope this makes sense!

Kind regards.

"Dave Peterson" wrote:

Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

oscarcounts wrote:

I have two sheets. The second sheet obtains data from the first sheet. The
value (£) depends on three criteria in the same row. ie Code,Cost centre and
Department.
When all three match the value (£) is returned or if not 0.


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Lookup multi criteria

Actually, you'd only need to check for an error with this portion:

=if(isna(match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0)),0,longformulahere )

Dave Peterson wrote:

If you're using xl2007, look at =iferror() in Excel's help.

If you're xl2003 or below, then you could double up the formula:
=if(isna(thatlongformula),0,thatlongformula)

Personally, I'd use a couple of columns (say B and C):
The first one is just that formula
The second one is:
=if(isna(b2),0,b2)

and I'd hide column B.

Depending on how many rows are in the table and how many formulas you're going
to use, doubling up the formulas could really slow calculations down.

oscarcounts wrote:

Many thanks for your e-mail and formula. This is the formula that I am using
in the 2nd workbook which works when the three critreia and financial value
match. However when there is no match #N/A is returned. How can I replace the
#N/A with a 0 (zero) ?

=INDEX('[RBAS Trial balance.xls]TOTALS'!$F$2:$F$2520,MATCH(1,($A8='[RBAS
Trial balance.xls]TOTALS'!$B$2:$B$2520)*("Q02"='[RBAS Trial
balance.xls]TOTALS'!$C$2:$C$2520)*($C$3='[RBAS Trial
balance.xls]TOTALS'!$D$2:$D$2520),0))

Workbook 1. (Financial Trial balance)

Col B Codes (say 60001)
Col C Cost Centres ( say Q02)
Col D Departments ( say 801)
Col F Financial values ( say £100)

Workbook 2

The purpose is to obtain data from Col F in WB 1 when Code (col B), Cost
Centre (col C) and Dept (col D ) match. If there is no match a 0 (zero)
should be returned.

I hope this makes sense!

Kind regards.

"Dave Peterson" wrote:

Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

oscarcounts wrote:

I have two sheets. The second sheet obtains data from the first sheet. The
value (£) depends on three criteria in the same row. ie Code,Cost centre and
Department.
When all three match the value (£) is returned or if not 0.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Lookup multi criteria

Useing the two column solution works all OK. I attempted to re-write it in
one cell but have not been successful yet. I would prefer the one cell option
but I can progress my work using this remedy. If you could supply the one
cell option in full that would be great.( I may be entering wrongly!)

Many thanks for your assistance it is greatly appreciated.

"Dave Peterson" wrote:

Actually, you'd only need to check for an error with this portion:

=if(isna(match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0)),0,longformulahere )

Dave Peterson wrote:

If you're using xl2007, look at =iferror() in Excel's help.

If you're xl2003 or below, then you could double up the formula:
=if(isna(thatlongformula),0,thatlongformula)

Personally, I'd use a couple of columns (say B and C):
The first one is just that formula
The second one is:
=if(isna(b2),0,b2)

and I'd hide column B.

Depending on how many rows are in the table and how many formulas you're going
to use, doubling up the formulas could really slow calculations down.

oscarcounts wrote:

Many thanks for your e-mail and formula. This is the formula that I am using
in the 2nd workbook which works when the three critreia and financial value
match. However when there is no match #N/A is returned. How can I replace the
#N/A with a 0 (zero) ?

=INDEX('[RBAS Trial balance.xls]TOTALS'!$F$2:$F$2520,MATCH(1,($A8='[RBAS
Trial balance.xls]TOTALS'!$B$2:$B$2520)*("Q02"='[RBAS Trial
balance.xls]TOTALS'!$C$2:$C$2520)*($C$3='[RBAS Trial
balance.xls]TOTALS'!$D$2:$D$2520),0))

Workbook 1. (Financial Trial balance)

Col B Codes (say 60001)
Col C Cost Centres ( say Q02)
Col D Departments ( say 801)
Col F Financial values ( say £100)

Workbook 2

The purpose is to obtain data from Col F in WB 1 when Code (col B), Cost
Centre (col C) and Dept (col D ) match. If there is no match a 0 (zero)
should be returned.

I hope this makes sense!

Kind regards.

"Dave Peterson" wrote:

Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

oscarcounts wrote:

I have two sheets. The second sheet obtains data from the first sheet. The
value (ÀšÃ‚£) depends on three criteria in the same row. ie Code,Cost centre and
Department.
When all three match the value (ÀšÃ‚£) is returned or if not 0.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Lookup multi criteria

I'd still use two columns to keep the calculations speedy.

=if(isna(match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0)),0,
index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0)))

Still an array formula.


oscarcounts wrote:

Useing the two column solution works all OK. I attempted to re-write it in
one cell but have not been successful yet. I would prefer the one cell option
but I can progress my work using this remedy. If you could supply the one
cell option in full that would be great.( I may be entering wrongly!)

Many thanks for your assistance it is greatly appreciated.

"Dave Peterson" wrote:

Actually, you'd only need to check for an error with this portion:

=if(isna(match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0)),0,longformulahere )

Dave Peterson wrote:

If you're using xl2007, look at =iferror() in Excel's help.

If you're xl2003 or below, then you could double up the formula:
=if(isna(thatlongformula),0,thatlongformula)

Personally, I'd use a couple of columns (say B and C):
The first one is just that formula
The second one is:
=if(isna(b2),0,b2)

and I'd hide column B.

Depending on how many rows are in the table and how many formulas you're going
to use, doubling up the formulas could really slow calculations down.

oscarcounts wrote:

Many thanks for your e-mail and formula. This is the formula that I am using
in the 2nd workbook which works when the three critreia and financial value
match. However when there is no match #N/A is returned. How can I replace the
#N/A with a 0 (zero) ?

=INDEX('[RBAS Trial balance.xls]TOTALS'!$F$2:$F$2520,MATCH(1,($A8='[RBAS
Trial balance.xls]TOTALS'!$B$2:$B$2520)*("Q02"='[RBAS Trial
balance.xls]TOTALS'!$C$2:$C$2520)*($C$3='[RBAS Trial
balance.xls]TOTALS'!$D$2:$D$2520),0))

Workbook 1. (Financial Trial balance)

Col B Codes (say 60001)
Col C Cost Centres ( say Q02)
Col D Departments ( say 801)
Col F Financial values ( say £100)

Workbook 2

The purpose is to obtain data from Col F in WB 1 when Code (col B), Cost
Centre (col C) and Dept (col D ) match. If there is no match a 0 (zero)
should be returned.

I hope this makes sense!

Kind regards.

"Dave Peterson" wrote:

Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

oscarcounts wrote:

I have two sheets. The second sheet obtains data from the first sheet. The
value (ÀšÃ‚£) depends on three criteria in the same row. ie Code,Cost centre and
Department.
When all three match the value (ÀšÃ‚£) is returned or if not 0.

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Lookup multi criteria


Thanks again, I will try it out tomorrow and compare the speed.

Regards

"Dave Peterson" wrote:

I'd still use two columns to keep the calculations speedy.

=if(isna(match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0)),0,
index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0)))

Still an array formula.


oscarcounts wrote:

Useing the two column solution works all OK. I attempted to re-write it in
one cell but have not been successful yet. I would prefer the one cell option
but I can progress my work using this remedy. If you could supply the one
cell option in full that would be great.( I may be entering wrongly!)

Many thanks for your assistance it is greatly appreciated.

"Dave Peterson" wrote:

Actually, you'd only need to check for an error with this portion:

=if(isna(match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0)),0,longformulahere )

Dave Peterson wrote:

If you're using xl2007, look at =iferror() in Excel's help.

If you're xl2003 or below, then you could double up the formula:
=if(isna(thatlongformula),0,thatlongformula)

Personally, I'd use a couple of columns (say B and C):
The first one is just that formula
The second one is:
=if(isna(b2),0,b2)

and I'd hide column B.

Depending on how many rows are in the table and how many formulas you're going
to use, doubling up the formulas could really slow calculations down.

oscarcounts wrote:

Many thanks for your e-mail and formula. This is the formula that I am using
in the 2nd workbook which works when the three critreia and financial value
match. However when there is no match #N/A is returned. How can I replace the
#N/A with a 0 (zero) ?

=INDEX('[RBAS Trial balance.xls]TOTALS'!$F$2:$F$2520,MATCH(1,($A8='[RBAS
Trial balance.xls]TOTALS'!$B$2:$B$2520)*("Q02"='[RBAS Trial
balance.xls]TOTALS'!$C$2:$C$2520)*($C$3='[RBAS Trial
balance.xls]TOTALS'!$D$2:$D$2520),0))

Workbook 1. (Financial Trial balance)

Col B Codes (say 60001)
Col C Cost Centres ( say Q02)
Col D Departments ( say 801)
Col F Financial values ( say ÀšÃ‚£100)

Workbook 2

The purpose is to obtain data from Col F in WB 1 when Code (col B), Cost
Centre (col C) and Dept (col D ) match. If there is no match a 0 (zero)
should be returned.

I hope this makes sense!

Kind regards.

"Dave Peterson" wrote:

Saved from a previous post:

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100),0))

(all in one cell)

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can only use the whole column in xl2007.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

oscarcounts wrote:

I have two sheets. The second sheet obtains data from the first sheet. The
value (ÀšÃ€šÃ‚£) depends on three criteria in the same row. ie Code,Cost centre and
Department.
When all three match the value (ÀšÃ€šÃ‚£) is returned or if not 0.

--

Dave Peterson


--

Dave Peterson

--

Dave Peterson


--

Dave Peterson

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
Multi-criteria lookup with Multiple results andy62 Excel Worksheet Functions 3 September 22nd 06 03:40 AM
Multi Criteria lookup epotter Excel Discussion (Misc queries) 3 July 6th 06 12:32 AM
Question regarding wildcard in multi-criteria IF formula Malvaro Excel Worksheet Functions 3 December 12th 05 10:52 PM
Multi Criteria then sum lost at work Excel Worksheet Functions 13 June 28th 05 01:00 AM
How do I do multi VLOOKUP's based on certain criteria per cell? Milky_UK Excel Worksheet Functions 3 June 17th 05 05:51 PM


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

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"