Decomposing a number written in standard form into parts.

andreascostas

Board Regular
Joined
Jan 11, 2011
Messages
150
I am trying to create a worksheet for my students. Decomposing a number written in standard form
To its individual parts. Example in A1 cell I will randomly generate a number into the hundred million.
In B1 I want it to shown the parts of that number. Example
In A1: 904,004,350
In B1 I need it to show: 9 hundred millions + 4 millions + 4 thousands + 3 hundreds + 5 tens
In other words, if a digit is zero, I don’t want it to show.
Thanks in advance
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
in C1 "Hundred millions"
in D1 "Millions"
in E1 "Thousands"
in F1 "Hundreds"
in G1 "Tens"

in A2 your random number

in B2
=A2+10000000000

in C2
=IF(MID(B2,2,1)="0","",MID(B2,2,1))+0
in D2
=IF(MID(B2,5,1)="0","",MID(B2,5,1))+0
in E2
=IF(MID(B2,8,1)="0","",MID(B2,8,1))+0
in F2
=IF(MID(B2,9,1)="0","",MID(B2,9,1))+0
in G2
=IF(MID(B2,10,1)="0","",MID(B2,10,1))+0
 
Upvote 0
OK, what happens when the random number has a digit other than zero in the ten millions place, or in the ten thousands place?
 
Upvote 0
You didnt specify ten millions or ten thousands in your original description, just

hundred millions
millions
thousands
hundreds
tens

If you wanted to display the other digits when they are not zero then you should have provided several examples to clarify that.

Based on your updates this would probably be easier.

Place the headings starting at C1, hundred millions, ten millions, millions etc going across to K1
Decide your maximum random number, I'm assuming 999,999,999.

A2 has random number

in B2
=A2+1000000000

in C2
=IF(MID($B2,COLUMN()-1,1)="0","",MID($B2,COLUMN()-1,1))

copy across to column K.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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