LASTUSEDCOLUMN

=LASTUSEDCOLUMN(0)

LASTUSEDCOLUMN returns the last column with an entry in the current sheet.

RicoS

Board Regular
Joined
May 1, 2019
Messages
62
LASTUSEDCOLUMN returns the last column with an entry in the current sheet.

Excel Formula:
=LAMBDA(colFrom,
        LET(c,IF(colFrom=0,16000,colFrom),
              i,MAX((MOD(c,10^{1;2;3})=0)*{1;2;3}),
              j,LOG(c),
              k,(j<4)*(j=INT(j)),
              x,0+(COUNTA(INDIRECT("C"&c&":C"&MIN(16384,c+(10^i)-1),FALSE))>0),
              return,IF((x*(i=0))=1,c,LASTUSEDCOLUMN(c+(x*(10^i))-(10^(i-(x*i)-(k*(x=0)))))),
        return)
)
 
Upvote 0
this new formula more fast than other one , thank you so much xlamba
 
this new formula more fast than other one , thank you so much xlamba
For you, always 😊✌️
I will develop more functions to also extract these values and continue the scanning for the next last row/column. Stay tuned!!😉😊🙏
 

Forum statistics

Threads
1,215,883
Messages
6,127,544
Members
449,385
Latest member
KMGLarson

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