# Excel formula to return last non-empty cell

1. ## Excel formula to return last non-empty cell

Hi all,

I hope you are all well and safe.

I am trying to get a formula that returns the value of the last non-empty cell of a row.

I am currently using the following formula which returns the last value of the last cell of the row but not the value of the last non-empty cell:
=IFERROR(LOOKUP(2,1/(A1:F1<>""), A1:F1), "")  Register To Reply

2. ## Re: Excel formula to return last non-empty cell

I am not sure I understand your question what is the difference between the last value of the last cell of the row and value of the last non-empty cell

maybe attach an example as per the banner so we can see what you are asking

unless you mean f1 or if(isblank(f1),"",f1)  Register To Reply

3. ## Re: Excel formula to return last non-empty cell

Hi davsth,

Here is the attachment.  Register To Reply

4. ## Re: Excel formula to return last non-empty cell

=IFERROR(LOOKUP(2,1/(B2:F2>0), B2:F2), "")
The reason your formula didn't work, is that F2 contains a 0, which you have chosen to hide.  Register To Reply

There are currently 1 users browsing this thread. (0 members and 1 guests) 