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

x
?
Solved

second highest value difference

Posted on 2016-11-19
11
Medium Priority
?
49 Views
Last Modified: 2016-11-20
Hi,
I would like a formula to determine second highest value within a range and display difference in a cell adjacent
to highest value.
Please see attachment for fuller explanation
Thanks
Ian
rating-diff.xlsx
0
Comment
Question by:racepro
[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
  • 5
  • 5
11 Comments
 

Author Comment

by:racepro
ID: 41894208
There are over 80,000 rows with an average of 8 in each event.
Can you please refer to spreadsheet and place formula in column headed '???'
Thanks
Ian
0
 
LVL 23

Accepted Solution

by:
Ejgil Hedegaard earned 1000 total points
ID: 41894265
0
 
LVL 49

Assisted Solution

by:Martin Liss
Martin Liss earned 1000 total points
ID: 41894408
Ejil's formula is very nice and it works, but one problem I see is that if the number of rows increases or decreases the formulas would need to be changed. To avoid that problem you can create a named range from column "A" named something like IDs, and as the formula for the named range use =OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A)-1,1) which will make it dynamic. Then move the explanitory text to the right somewhere to get it out of the way and create a similar range for column "B" called something like Ratings and use =OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B:$B)-1,1) as the formula. Then in C2 use the formula =IF(B2=MAX(INDEX((IDs=A2)*Ratings,,)),MAX(INDEX((IDs=A2)*Ratings,,))-LARGE(INDEX((IDs=A2)*Ratings,,),2),0) and copy down.

I've attached a  modified workbook.
28984193.xlsx
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:racepro
ID: 41894465
Ejgil's Your formula works fine. I found Martin's a bit complicated being a novice, I'd need more tuition on that one.
Thanks guys
Ian
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 41894467
I'd need more tuition on that one.
I'm happy to help. Do you understand Named Ranges?
0
 

Author Comment

by:racepro
ID: 41894468
not really...... I know of them but never used them
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 41894492
Take a look at the attached.
Named-range-Tutorial.xlsx
0
 

Author Comment

by:racepro
ID: 41895072
Thanks Martin for the tutorial. Very helpful
Ian
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 41895115
You're welcome and I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2016
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2015
0
 

Author Comment

by:racepro
ID: 41895140
Thanks again Martin, I'll have a read. I have a file I'd like to send you.
If you can acknowledge email when you can.
Thanks
Ian
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 41895147
I removed the email address from your post since you shouldn't publicly display things like that. If you want to send me a file, you can click on the image of me in this post and "message" me.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

661 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