Solved

Excel Formula Question

Posted on 2011-02-15
4
234 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 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

Office 365 Training for Admins - 7 Day Trial

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

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!
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

627 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