Getting the result of last entry in each row

dankar

Board Regular
Joined
Mar 23, 2016
Messages
113
Office Version
  1. 365
Platform
  1. Windows
I have a large file with fields from year 2012 to 2020, I want to get the final entry for each row in the last column "A" (last year of year),

for example:

row no. 2, last entry is 2015 (G2) so the result will be "R3A"
row no 3 is blank since there is no entry at all
row no 4 , last entry is 2016 (F4) so result will be "Q6"
row no 5 , last entry is 2016 (F5) so result will be "R4B3A"
row no 6, last entry is 2018 (D6) so result will be "R4B5C3B"
row no 7, last entry is 2019 (D7) so result will be "R4B5C4C1"
row no 8, last entry is 2020 (B8) so result will be "YB1A"


ABDDEFGHIJ
1​
Last result of year202020192018201720162015201420132012
2​
R3AR3AR3AR3AR3
3​
4​
Q6Q6Q6Q6Q6Q6
5​
R4B3AR4B3AR4B3AR4B3
6​
R4B5C3BR4B5C3BR4B5C3BR4B5C3
7​
R4B5C4C1R4B5C4C1R4B5C4CR4B5C4
8​
YB1AYB1AR4B5C5B2B


Thanks
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi,

This is one way.

Array formula to be confirmed with CSE, if you have newer version of Excel, you may not need CSE:

Book3.xlsx
ABCDEFGHIJ
1Last result of year202020192018201720162015201420132012
2R3AR3AR3AR3AR3
3 
4Q6Q6Q6Q6Q6Q6
5R4B3AR4B3AR4B3AR4B3
6R4B5C3BR4B5C3BR4B5C3BR4B5C3
7R4B5C4C1R4B5C4C1R4B5C4CR4B5C4
8YB1AYB1AR4B5C5B2B
Sheet1072
Cell Formulas
RangeFormula
A2:A8A2=IFNA(INDEX(B2:J2,MATCH(TRUE,B2:J2<>"",0)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hi,

This is one way.

Array formula to be confirmed with CSE, if you have newer version of Excel, you may not need CSE:

Book3.xlsx
ABCDEFGHIJ
1Last result of year202020192018201720162015201420132012
2R3AR3AR3AR3AR3
3 
4Q6Q6Q6Q6Q6Q6
5R4B3AR4B3AR4B3AR4B3
6R4B5C3BR4B5C3BR4B5C3BR4B5C3
7R4B5C4C1R4B5C4C1R4B5C4CR4B5C4
8YB1AYB1AR4B5C5B2B
Sheet1072
Cell Formulas
RangeFormula
A2:A8A2=IFNA(INDEX(B2:J2,MATCH(TRUE,B2:J2<>"",0)),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
Thank you so much...worked like a charm! :)
 
Upvote 0
You're welcome, thanks for the feedback.
 
Upvote 0
Another way, formula is Normally entered, so No CSE needed:

Book3.xlsx
ABCDEFGHIJ
1Last result of year202020192018201720162015201420132012
2R3AR3AR3AR3AR3
3 
4Q6Q6Q6Q6Q6Q6
5R4B3AR4B3AR4B3AR4B3
6R4B5C3BR4B5C3BR4B5C3BR4B5C3
7R4B5C4C1R4B5C4C1R4B5C4CR4B5C4
8YB1AYB1AR4B5C5B2B
Sheet1072
Cell Formulas
RangeFormula
A2:A8A2=IFNA(INDEX(B2:J2,MATCH("?*",B2:J2,0)),"")
 
Upvote 0
one more thing please, is there a way to add the year in a new column,
so for example, for row 2 it will be 2015
...
...
row 4 =2016
row 8=2020


HABDDEFGHIJ
1Year Last result of year
2020
2019
2018
2017
2016
2015
2014
2013
2012
22015R3AR3AR3AR3AR3
3
42016Q6Q6Q6Q6Q6Q6
52016R4B3AR4B3AR4B3AR4B3
62018R4B5C3BR4B5C3BR4B5C3BR4B5C3
72019R4B5C4C1R4B5C4C1R4B5C4CR4B5C4
82020YB1AYB1A

Thanks you
 
Upvote 0
one more thing please, is there a way to add the year in a new column,
so for example, for row 2 it will be 2015
...
...
row 4 =2016
row 8=2020

Yes, formulas Normally entered:

Book3.xlsx
ABCDEFGHIJK
1YearLast result of year202020192018201720162015201420132012
22015R3AR3AR3AR3AR3
3  
42016Q6Q6Q6Q6Q6Q6
52016R4B3AR4B3AR4B3AR4B3
62018R4B5C3BR4B5C3BR4B5C3BR4B5C3
72019R4B5C4C1R4B5C4C1R4B5C4CR4B5C4
82020YB1AYB1AR4B5C5B2B
Sheet1072
Cell Formulas
RangeFormula
A2:A8A2=IFNA(INDEX(C$1:K$1,MATCH("?*",C2:K2,0)),"")
B2:B8B2=IFNA(INDEX(C2:K2,MATCH("?*",C2:K2,0)),"")
 
Upvote 0
Solution
Yes, formulas Normally entered:

Book3.xlsx
ABCDEFGHIJK
1YearLast result of year202020192018201720162015201420132012
22015R3AR3AR3AR3AR3
3  
42016Q6Q6Q6Q6Q6Q6
52016R4B3AR4B3AR4B3AR4B3
62018R4B5C3BR4B5C3BR4B5C3BR4B5C3
72019R4B5C4C1R4B5C4C1R4B5C4CR4B5C4
82020YB1AYB1AR4B5C5B2B
Sheet1072
Cell Formulas
RangeFormula
A2:A8A2=IFNA(INDEX(C$1:K$1,MATCH("?*",C2:K2,0)),"")
B2:B8B2=IFNA(INDEX(C2:K2,MATCH("?*",C2:K2,0)),"")
Oh wow, You are the best ! :) thank you soooo much!
 
Upvote 0

Forum statistics

Threads
1,214,801
Messages
6,121,644
Members
449,045
Latest member
Marcus05

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