Simple Public Function? Have the formula = the value in the cell 1 to the left

MNpoker

Board Regular
Joined
Dec 15, 2003
Messages
154
I want to write a public function where the value is the cell one to the left.

Help!

Actually it's a bit more than that but I think that would get me there.
It's really the next cell with a value above the cell one to the left / the value one cell to the left

Thanks!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
can you explain the above more clearly please?

Say I put = Publicfunction1() in cell B5



First find the value in A5 (this is the denominator)

If there is a value in A4 then that value is the numerator if not
If there is a value in A3 then that value is the numerator if not
.......................

And so on.
 
Last edited:
Upvote 0
to clarify... you mean in non-VBA terms something like the below (posted into C7)

=IF(OR(ROW(C7)=1,COLUMN(C7)=1),-1,LOOKUP(9.99999999999999E+307,OFFSET(C7,1-ROW(C7),-1):OFFSET(C7,-1,-1))/OFFSET(C7,0,-1))
 
Last edited:
Upvote 0
Code:
Function CellToLeft()
CellToLeft = Application.Caller.Offset(, -1).Value
End Function

No idea why you'd want this though
 
Upvote 0

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,039
Latest member
Mbone Mathonsi

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