reverse

zoharb

Board Regular
Joined
Nov 24, 2011
Messages
83
Office Version
  1. 2021
  2. 2013
Respected,
has extracted the MAX value from a list but has to do now reverse thing of finding the month and year when this sales was done.
Thank you in advance
HAPPY NEW YEAR in advance
Zohar Batterywala

EDIT:
jul19 needed in c5 for on basis of max extracted in b5
Zohar Batterywala
 

Attachments

  • reverse vlookup.jpg
    reverse vlookup.jpg
    21.5 KB · Views: 25
Last edited by a moderator:
Does this do what you want?
2024-12-30.xlsx
ABCDE
1Monthly SalesAprilMayJuneJuly
22017546877901347002163330
32018569808402359733158234
42019610758414575866167789
5
6Max167789
7MonthJuly
8Year2019
9Month & YearJuly 2019
Sheet1
Cell Formulas
RangeFormula
C6C6=MAX(B2:E4)
C7C7=LOOKUP($C$6,B2:E4,B1:E1)
C8C8=VLOOKUP($C$6,A1:E4,1)
C9C9=C7&" "&C8
 
Upvote 0
Does this do what you want?
2024-12-30.xlsx
ABCDE
1Monthly SalesAprilMayJuneJuly
22017546877901347002163330
32018569808402359733158234
42019610758414575866167789
5
6Max167789
7MonthJuly
8Year2019
9Month & YearJuly 2019
Sheet1
Cell Formulas
RangeFormula
C6C6=MAX(B2:E4)
C7C7=LOOKUP($C$6,B2:E4,B1:E1)
C8C8=VLOOKUP($C$6,A1:E4,1)
C9C9=C7&" "&C8
That does not seem to work if the maximum value is not in the last cell.
Here is an example with your formulas when the max is located elsewhere.

1735591747210.png


The answer should be "June 2018".
 
Upvote 0
Does this do what you want?
2024-12-30.xlsx
ABCDE
1Monthly SalesAprilMayJuneJuly
22017546877901347002163330
32018569808402359733158234
42019610758414575866167789
5
6Max167789
7MonthJuly
8Year2019
9Month & YearJuly 2019
Sheet1
Cell Formulas
RangeFormula
C6C6=MAX(B2:E4)
C7C7=LOOKUP($C$6,B2:E4,B1:E1)
C8C8=VLOOKUP($C$6,A1:E4,1)
C9C9=C7&" "&C8
yes this is the answer but I think I will not use it in all other situations.anyway thank you. happy new year
 
Upvote 0
This should work in 2021:
Book1
ABCDE
1Monthly SalesAprilMayJuneJuly
2201754687790139999999163330
32018569805555555597334
42019610758414575866167789
5
6Max9999999
7Month & YearJune 2017
Sheet1
Cell Formulas
RangeFormula
C6C6=MAX(B2:E4)
C7C7=CONCAT(IF(C6=B2:E4,B1:E1&" "&A2:A4,""))
 
Upvote 0
Solution
This should work in 2021:
Book1
ABCDE
1Monthly SalesAprilMayJuneJuly
2201754687790139999999163330
32018569805555555597334
42019610758414575866167789
5
6Max9999999
7Month & YearJune 2017
Sheet1
Cell Formulas
RangeFormula
C6C6=MAX(B2:E4)
C7C7=CONCAT(IF(C6=B2:E4,B1:E1&" "&A2:A4,""))
Respected Sir,
It worked. Thank you VERY VERY MUCH.
Can you please make me understand the logic. PLEASE
Zohar Batterywala
 

Attachments

  • Screenshot 2024-12-31 080315.jpg
    Screenshot 2024-12-31 080315.jpg
    24.1 KB · Views: 7
Upvote 0
Can you please make me understand the logic
Starting in 2021 with the array functionality added to Excel you can perform binary vector cross product. Some examples:

Book1
ABCDE
1Array 1 * Array 2123
21123
32246
43369
5
6Array 1 ^ Array 2123
71111
82248
933927
10
11Array 1 concats Array 2AprilMayJuneJuly
122017April 2017May 2017June 2017July 2017
132018April 2018May 2018June 2018July 2018
142019April 2019May 2019June 2019July 2019
Sheet2
Cell Formulas
RangeFormula
B2:D4B2=A2:A4*B1:D1
B7:D9B7=A7:A9^B6:D6
B12:E14B12=B11:E11&" " &A12:A14
Dynamic array formulas.


From here, the IF logic returns the concatenated string if it's equal to the MAX, else return empty strings. Finally, CONCAT to reduces the matrix into a single cell (removing the empty strings).

In fact, it'll return all dates with containing the max value. Changed CONCAT to TEXTJOIN for better formatting.
Book1
ABCDE
1Monthly SalesAprilMayJuneJuly
2201754687790135555555163330
3201856980555555584
42019610758414575866167789
5
6Max5555555
7Month & YearJune 2017, May 2018
Sheet1
Cell Formulas
RangeFormula
C6C6=MAX(B2:E4)
C7C7=TEXTJOIN(", ",,IF(C6=B2:E4,B1:E1&" "&A2:A4,""))
 
Upvote 0
I had no idea Excel could do this. Within your IF formula =CONCAT(IF(C6=B2:E4,B1:E1&" "&A2:A4,"")) I was of the thinking where you have used a range in the true aspect B1:E1&" "&A2:A4 I thought this would return all of the values from B1:E1 and A2:A4 as there was a TRUE value in the range and not just return the true value for that individual cell within the range (hope that makes sense what I'm saying) either way @Cubist very informative and great explanation, thank you.
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top