Forum Discussion
How to Post a Cumulative Rank for a Stock to Each Quarters Data
- Aug 27, 2024
As SergeiBaklan has said, the third parameter in your use of VLOOKUP is the error. It should be consistently the number 2, i.e., the second column in the table in which you're seeking the corresponding rank of the company.
=VLOOKUP(C2,$C$2:$D$4,2,0)
mathetes Thank you again. However, I used Vlookup and it's not working. Not sure what I am doing wrong. Can you see any error in my formula, if you don't mind? Here are the odd results from a tiny sample test. In Column A it works only for Exxon, whose Rank is 2 (from Col D). But it refuses to pick up col D rank for Walmart or GE? Weird. (Note: In the second set of 3 I sorted stock names in alpha order. No luck.)
As SergeiBaklan has said, the third parameter in your use of VLOOKUP is the error. It should be consistently the number 2, i.e., the second column in the table in which you're seeking the corresponding rank of the company.
=VLOOKUP(C2,$C$2:$D$4,2,0)- TsmarscoAug 27, 2024Copper Contributor
mathetes Eureka! As Archimedes said. The Vlookup works now. I just had to adjust my range. Both your explanations are better than the Vlookup code description:
If you are MS Staff, MS feedback: To be clearer, I would have phrased this:
(lookup_value,table_range,lookup_col_no,{0=exact, 1=approx))
Thanks!
- mathetesAug 27, 2024Gold Contributor
I'm glad you were able to make the VLOOKUP work with my correction to it; for the record INDEX and MATCH as suggested by SergeiBaklan would have worked too, given the right use of the several variables (to include the address of the range or array being searched). Those are all very powerful functions; there are other ways to retrieve data from tables, with those being perhaps the most common. You'd do well to familiarize yourself with them, and I think you'll find this on-line reference a good resource for your further learning.