Solved

Excel Formula Question

Posted on 2011-02-15
4
231 Views
Last Modified: 2012-08-14
I have an excel spreadsheet that has three columns of data and I need to return the value in the third column based on criteria in the other two.  For example:

Col1    Col2     Col3        Col4
1         2          asdf        zxcv
1         2          qwer       zxcv
1         1          zxcv        zxcv
1         2          asdd        zxcv
2         2          qwds       qw32
2         1          qw32       qw32
3         1          asert        asert
3         2          qwed       asert
3         2          qwxa       asert
3         2          saew       asert

Column 4 is where the formula should go and those are the values that should be returned.  The idea being that the formula will evaluate column2 (looking for the minimum value) where the values in column1 are equal and place the corresponding value in column 3 in column 4.

Thanks.
0
Comment
Question by:palacesports
  • 2
  • 2
4 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 34900413
You can use this array formula in D2 copied down

=INDEX(C$2:C$11,MATCH(1,(B$2:B$11=MIN(IF(A$2:A$11=A2,B$2:B$11)))*(A$2:A$11=A2),0))

confirmed with CTRL+SHIFT+ENTER

If the minimum value is duplicated for an entry in column A the formula will return the first value in column C for those minimums.....

see attached

regards, barry
26823496.xls
0
 

Author Comment

by:palacesports
ID: 34901512
Barry,

Thanks for the quick response!  That is an impressive formula.  For some reason I'm receiving a "value not available error" in my spreadsheet with this formula.  I've stepped through the formula and it seems to evaluate how I would expect it to, but the end result is "INDEX($C$2:$C:$C$11,#N/A)" and I'm not sure why.  The formula works like a champ in your spreadsheet though.  Any idea why it would behave this way?

Thanks.
0
 
LVL 50

Assisted Solution

by:barry houdini
barry houdini earned 500 total points
ID: 34901984
I assume you used CTRL+SHIFT+ENTER

If you did and you still get #N/A error then that's probably from the match function. There are a number of possible causes, are you sure column B is numeric (values could be formatted as text). Test by using

=COUNT(B2:B11)

That counts numbers - you ought to get 10 for 10 numbers if you get zero (or fewer than 10) then your numbers are probably formatted as text. Try converting to numeric like this

Select column B > data > text to columns > finish

If that doesn't work then can you attach the workbook....or a sample?

regards, barry
0
 

Author Comment

by:palacesports
ID: 34908323
Thanks Barry.  It was the CTRL+SHIFT+ENTER validation step that I messed up.  I didn't validate the formula after I modified it.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook Free & Paid Tools
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question