Calculating the range (distance) between two unempty cells

Usercode

Board Regular
Joined
Aug 18, 2017
Messages
107
Office Version
  1. 2016
Platform
  1. Windows
I have a range of values spread across in rows from A to AA. some cells are empty and some are not. and the cells that are not empty have unordered values. Is there a way to calculate the range between the first cell and last cell which have values? I hope explanation is good. I can do this with extra tables/ cells etc. but would it be possible to do this with a tricky formula? please. thanks. I posted an example image. In the first I would like to know the range between cell Y and cell E. and in the second row, it is between cell x and cell B.


f8rji0ouf
example.png
 
Last edited:

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Maybe:
This is an array formula and must be entered with CTRL-SHIFT-ENTER.
Excel Workbook
ABCDEFGHIJKL
11574
2468908
325
4
5Range
6Row 110
7Row 28
8Row 33
Sheet
 
Upvote 0
So is the answer 22 for your example?
 
Upvote 0
Your welcome. Thanks for the feedback.
SHG - not sure I understand your question. This is to calculate the number of cells from the 1st value in a row to the last value in the row.
 
Upvote 0
Your welcome. Thanks for the feedback.
SHG - not sure I understand your question. This is to calculate the number of cells from the 1st value in a row to the last value in the row.
Thanh you so much, U almost saved my day. My problem is that what if I wanted to know the distance from the 1st value to the 2nd, or 3rd or 4th. Not to the last.
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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