Total Empty column between two characters

bdtran

New Member
Joined
Oct 11, 2018
Messages
33
Hello Team,

I need your help with a formula to calculate how many empty column between of the letter “A” as in the row#2. The result that I am looking for should be the same as in row#1 as shown below.

Any help would be greatly appreciated.
BDT


ABCDFGHIJKLMNOPQRSTUVWXYZAA
ROW#112172
ROW#2AAAAAAAAAAA

<tbody>
</tbody>
 
All,

While checking the data, I encountered a sheet containing the sample data as in the table below. Similarly, I need a formula for the result in row#1 with total of columns (not empty) between the letter "A".

Thank you so much for all the help.
BDT


ABCDEFGHIJKLMNOPQRSTUVWXYZ
12128
2A10AAA0AAAAA11A11010110A

<tbody>
</tbody>
I think this modification to the formulas I posted in Message #9 will do what you are asking for...

If it is possible for cell A2 to be blank, then put this formula in cell A1, otherwise leave cell A1 blank...

=IF(AND(A2<>"A",B2="A"),1,"")

Now put his formula in cell B1 and copy it across to the end of your data...

=IF(AND(B2<>"A",C2="A"),COLUMNS($A1:B1)-COUNTIF($A2:B2,"A")-SUM($A1:A1),"")
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Mr. Rothstein,

I tested both of your solutions for total empty and non-empty columns. I got the exactly result I am looking for.

Thank you so much for your help on this situation.

BDT
 
Upvote 0
Jtakw,

I replaced "A" with "zzz" as mentioned and it returned the corrected result.

Thanks again with your help.
BDT
 
Upvote 0
Here's the modified version my formula from Post # 8 that will handle both versions of your data in Post # 1 and # 10, whether or not the data starts with Blanks or Numbers in A2:


Book1
ABCDEFGHIJKLMNOPQRSTUVWX
1 2128
2A10AAA0AAAAA11A11010110A
Sheet688 (2)
Cell Formulas
RangeFormula
A1=IF(AND(A2<>"A",B2="A"),COLUMN()-IFERROR(LOOKUP("zzz",$A2:A2,COLUMN($A2:A2)),0),"")


Formula copied across.
 
Upvote 0

Forum statistics

Threads
1,214,885
Messages
6,122,090
Members
449,065
Latest member
Danger_SF

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