Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Formula for finding an element

Hi,

I have a spreadsheet:

1 2 100
5 6 200
5 11 300

I want to find a row which where first column has a specific value and
the second column has a specific value, and print a value in the third
column.

So, I want something like:

= FIND_VALUE (A1:A3 ; 5 ; B1:B3 ; 6 ; C1) // finds 5 in the first column
and 6 in the second
And it should show the value 200
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Formula for finding an element

One way...

Array entered** :

=INDEX(C1:C3,MATCH(1,IF(A1:A3=5,IF(B1:B3=6,1)),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"bim-bom" wrote in message
...
Hi,

I have a spreadsheet:

1 2 100
5 6 200
5 11 300

I want to find a row which where first column has a specific value and
the second column has a specific value, and print a value in the third
column.

So, I want something like:

= FIND_VALUE (A1:A3 ; 5 ; B1:B3 ; 6 ; C1) // finds 5 in the first column
and 6 in the second
And it should show the value 200



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Formula for finding an element

T. Valko pisze:
One way...

Array entered** :

=INDEX(C1:C3,MATCH(1,IF(A1:A3=5,IF(B1:B3=6,1)),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.


Thank you very much - it works perfectly. Now I know how to know make
things like that.
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Formula for finding an element

If you know that the pairs in columns A and B will always be unique, then you
can use SUMPRODUCT() in pre-2007 Excel, or SUMIFS() in Excel 2007. By
unique, I mean there would not be another row with 5 in a AND 6 in B.

Excel 2003 formula:
=SUMPRODUCT(--(A$1:A$3=5),--(B$1:B$3=6),C$1:C$3)
you can substitute a cell address for 5 and 6.

Excel 2007 formula:
=SUMIFS(C$1:C$3,A$1:A$3,"=" & 5,B$1:B$3,"=" & 6)
again, you can substitute cell addresses for the 5 and 6


"bim-bom" wrote:

Hi,

I have a spreadsheet:

1 2 100
5 6 200
5 11 300

I want to find a row which where first column has a specific value and
the second column has a specific value, and print a value in the third
column.

So, I want something like:

= FIND_VALUE (A1:A3 ; 5 ; B1:B3 ; 6 ; C1) // finds 5 in the first column
and 6 in the second
And it should show the value 200
.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Formula for finding an element

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"bim-bom" wrote in message
...
T. Valko pisze:
One way...

Array entered** :

=INDEX(C1:C3,MATCH(1,IF(A1:A3=5,IF(B1:B3=6,1)),0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the
SHIFT key then hit ENTER.


Thank you very much - it works perfectly. Now I know how to know make
things like that.



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 use a single nonrepeating XML element in a cell formula Paul Smith Excel Discussion (Misc queries) 1 September 29th 09 06:56 AM
look for missing element SteveDB1 Excel Worksheet Functions 1 August 7th 08 04:01 PM
nth element extract RSCARLISLE Excel Worksheet Functions 3 August 2nd 07 09:04 PM
How to define the 1st, 2nd and 3rd element DamiaoPastana Excel Worksheet Functions 4 June 8th 06 06:55 PM
How do I prevent a formula element from incrementing when copying Copying Excel Formulas Excel Worksheet Functions 3 September 8th 05 05:15 PM


All times are GMT +1. The time now is 04:29 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"