Get.Cell in LAMBDA Issue

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
3,142
Office Version
  1. 365
Platform
  1. Windows
I'm using =LAMBDA(Cel,SUM(GET.CELL(16,Cel))) to return the column width with decimals because =Cell("width",A1) only returns the integer value of the cell width. The named range is called CellWidth

Then I wanted to get the total column widths from a range of cells using this:
=LAMBDA(Rng,[X],[Cnt],[Wid],IF(X=0,ColsWidth(Rng,1,COLUMNS(Rng),0),IF(X<Cnt,ColsWidth(Rng,X+1,Cnt,Wid+CellWidth(INDEX(Rng,1,X))),Wid+CellWidth(INDEX(Rng,1,X)))))
It works fine and I call that named range ColsWidth

Then I thought that I could just put the CellWidth formula right into the ColsWidth Lambda formula and write it like this:
=LAMBDA(Rng,[X],[Cnt],[Wid],IF(X=0,ColsWidth(Rng,1,COLUMNS(Rng),0),IF(X<Cnt,ColsWidth(Rng,X+1,Cnt,Wid+Get.Cell(16,INDEX(Rng,1,X))),Wid+Get.Cell(16,INDEX(Rng,1,X)))))

It gives me an error. Am I to assume that the Get.Cell function doesn't know how to work with variables in the Lambda function?

I wanted to post my Lambda function on this site as a stand alone function, but it may turn out that I'll have to provide instructions for the simple CellWidth Lambda also.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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