# From column A to B special formatting? and how to calculate

#### nova_sweet

##### New Member
Hi!

I have a question about the following sheet. Having a column A with numbers (that can change sometimes) and a column B where the numbers should be shown as a range (do not know if you call it that). The numbers in B should change depending on what the numers i A are.
Maybe best with an exampel:

How is it possible to show the range (from xxx to xxx) and how is can it be calculated?

Thankfully for all ideas.

Best regards!

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

#### Special-K99

##### Well-known Member
If you're counting the numbers from 000-019 as 20
then

020-028 is 9 not 8
112-195 is 84 not 83

in B1 put 0

in C1 put
=SUM(A\$1:A1)-1
and copy down the column

in B2
=C1+1
and copy down the column

Columns B & C are your output "from" and "to"

Last edited:

#### FormR

##### MrExcel MVP
Hi, as per special-K99 I don't think you being consistent with the way you are deriving the start and end numbers in each range posting the full table of results might help to clarify.

Can you complete that example table with the rest of the results and paste directly in the thread?

Last edited:

#### nova_sweet

##### New Member
Ok. Yes. You are right. My bad. Very confusing the whole thing......

I typed in the numbers by hand just to give an impression how it should be. I do not have a mathematical formula behind this.

Last edited:

#### nova_sweet

##### New Member
Thank you. I am deeply impressed. It seems almost to easy to be true
But it looks exactly how I had in mind.
I will have to do some other work-stuff now, but will try this out more later on.
Thanks again!

Best regards,
Annika

#### nova_sweet

##### New Member
Hello again,

I have one more question: your suggestion works fine but how could I manage to show empty cells (B and C) in case A has the value 0?

Replies
1
Views
499
Replies
9
Views
665
Replies
13
Views
2K
Replies
5
Views
552
Replies
0
Views
799

1,191,688
Messages
5,988,079
Members
440,125
Latest member
vincentchu2369

### 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.

### Which adblocker are you using?

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

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