Find the number of nonempty cells to the left of a cell

dorg

New Member
Joined
Feb 14, 2022
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hi,
I have a row that contains text in some of the cells, e.g.:
_ _ A _ B _ _ _ C _ _ _ _ _ D _ _ D _ _ _ E.
Where _ represents an empty cell.

I need that the next row will show me the number of empty cells to the left of each of the non empty cells, with an exaction that if it's the same letter it skip it, e.g.:
_ _ 0 _ 2 _ _ _ 4 _ _ _ _ _ 6 _ _ _ _ _ _ 7.

I tried to use INDEX and MATCH functions to find the first non empty cell but I don't know how to define the list which I need to check.

Any suggestion Will be highly appreciated.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Book1
ABCDEFGHIJKLMNOPQRSTUVWX
7
8ABCDDE
902457
10
Sheet1
 
Upvote 0
This works here (probably close with ctrl+shift+return, arrayformula)

Map1
ABCDEFGHIJKLMNOPQRSTUVW
1abcdde
2
30 2   4     6  3   7
4
Blad1
Cell Formulas
RangeFormula
B3:U3B3=IF(B1="","",IFERROR(COLUMN()-LOOKUP(2,1/($A$1:A1<>""),COLUMN($A$1:A1)),0)+IFERROR((MMULT(LARGE(IFERROR(MATCH($A$1:A1,$A$1:A1,0),0),{1,2}),{1;-1})=0)*LOOKUP(2,1/($A$3:A3<>""),$A$3:A3),0))
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,213,494
Messages
6,113,981
Members
448,538
Latest member
alex78

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