Fetch last drawn salary month in excel

govind_bhuse

New Member
Joined
Mar 16, 2015
Messages
15
I have a list of employees and their month wise salary drawn. I need the "last salary drawn" & "month name" for all employees. The needed result is given in column H & I. Can we do it using excel formula ?

1614147842213.png
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
See if it works:

Book1
ABCDEFGHI
1NameJanFebMarAprMayJunLast MonthLast Salary Drawn
2150550550400Apr400
3800200100450Jun450
4100200200May200
5800250Feb250
6500550550550100450Jun450
Sheet4
Cell Formulas
RangeFormula
H2:H6H2=INDEX($B$1:$G$1,1,AGGREGATE(14,6,COLUMN($B2:$G2)+COLUMN($B2:$G2)/($B2:$G2>0),1)/2-1)
I2:I6I2=XLOOKUP(H2,$B$1:$G$1,B2:G2,0)
 
Upvote 0
try the following
Last Salary Drawn
Excel Formula:
=LOOKUP(2,1/(B2:G2<>""),B2:G2)
Last Month
Excel Formula:
=INDIRECT(ADDRESS(1,LOOKUP(2,1/(A2:G2<>""),COLUMN(2:2)),4))

Book1
ABCDEFGHI
1EmployeesJanFebMarAprMayJuneLast MonthLat Salary
2A100600800100Apr100
3B200500300200June200
4C300500600May600
5D250400Feb400
6E500100500350500500June500
Sheet1
 
Upvote 0
Solution
See if it works:

Book1
ABCDEFGHI
1NameJanFebMarAprMayJunLast MonthLast Salary Drawn
2150550550400Apr400
3800200100450Jun450
4100200200May200
5800250Feb250
6500550550550100450Jun450
Sheet4
Cell Formulas
RangeFormula
H2:H6H2=INDEX($B$1:$G$1,1,AGGREGATE(14,6,COLUMN($B2:$G2)+COLUMN($B2:$G2)/($B2:$G2>0),1)/2-1)
I2:I6I2=XLOOKUP(H2,$B$1:$G$1,B2:G2,0)
Hi Habtest,

Thanks for your reply,

Using your formulas, I was able to fetch the month but not able to fetch the "Last Drawn Salary", that is may be due to the xlooup formula which works in office 365 only and I am working on office 2019.
 
Upvote 0
try the following
Last Salary Drawn
Excel Formula:
=LOOKUP(2,1/(B2:G2<>""),B2:G2)
Last Month
Excel Formula:
=INDIRECT(ADDRESS(1,LOOKUP(2,1/(A2:G2<>""),COLUMN(2:2)),4))

Book1
ABCDEFGHI
1EmployeesJanFebMarAprMayJuneLast MonthLat Salary
2A100600800100Apr100
3B200500300200June200
4C300500600May600
5D250400Feb400
6E500100500350500500June500
Sheet1
Hi Fahad,

Thank you very much for the solution you provided, it has worked like a charm and resolved all my queries, the main thing is... it works in office 2019, which I am currently using. I received solution with other formulas like xlookup, which works in office 365 only and it is not working in office 2019.
 
Upvote 0
You are welcome govind.
Glad it worked the way needed.

Thanks for the feedback.
 
Upvote 0
Let_a.xlsm
ABCDEFGHI
1EmployeesJanFebMarAprMayJunLast Month data in rowLast Amt
2A100600800100Apr100
3B200500300200Jun200
4C300500600May600
5D250400Feb400
6E500100500350500500Jun500
2e
Cell Formulas
RangeFormula
H2:H6H2=LOOKUP(2,1/(A2:G2>0),A$1:G$1)
I2:I6I2=LOOKUP(2,1/(B2:G2<>""),B2:G2)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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