• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 61
  • Last Modified:

Excel IF Function? INDEX Function? Trying to return one value in a cell based on another value.

I need to return the month and year from a column, based on the second highest monthly sales figure in another column.

Please see attached.
Example-1.xlsx
0
Tim Jackoboice
Asked:
Tim Jackoboice
  • 2
1 Solution
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Please try this...

=IFERROR(INDEX(A2:A13,MATCH(LARGE($G$2:$G$13,2),G2:G13,0)),"")

Open in new window

and custom format the formula cell as "mm/yy"
The above formula will return a date which will be displayed in the format "mm/yy" after applying the custom format.

OR
=IFERROR(TEXT(INDEX(A2:A13,MATCH(LARGE($G$2:$G$13,2),G2:G13,0)),"mm/yy"),"")

Open in new window

The formula will return a text string in the format "mm/yy".
0
 
Tim JackoboiceOwnerAuthor Commented:
This didn't quite work. The formula returned 10/14, when it should have returned 12/14.

I changed the ",2" to a ",1" in your formula, and it works. Thanks.
0
 
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome!

I need to return the month and year from a column, based on the second highest monthly sales figure in another column.
This is why I added 2 in there. :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now