Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel Formula Question

Posted on 2011-02-15
4
Medium Priority
?
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 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 2000 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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

730 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