Solved

Excel Formula Question

Posted on 2011-02-15
4
225 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now