![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 17
|
Hi all,
Can anyone assist me in breaking apart a currecy formatted cell into dollars and cents? (have a second question below as well) For example I have $23.12 in cell a1, and would like to break it into $21 in cell a2 and $.12 in cell a3? All the various formatting functions such as Left, right, etc. seem to get hung up if I have a figure such as $1100.00 they won't recognize the 0s? My second question is how to break apart a number into each of its digits. For example, break the number 56346 in cell b1, into 5 in cell b2, 6 in cell b3, 3 in cell b4, etc...? Can figure out how using a very convoluted method, but must be an easier way? Thanks for the help! |
|
|
|
|
|
#2 | |
|
Board Regular
Join Date: Feb 2002
Location: Southfield,MI USA
Posts: 1,030
|
Hey,
Quote:
In A3: =A1-A2 Hope that helps, Adam |
|
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,319
|
Quote:
In B1 enter: =IF(INT(A1)=A1,A1,LEFT(A1,SEARCH(".",A1)-1)+0) In C1 enter: =IF(INT(A1)=A1,0,("0"&RIGHT(A1,LEN(A1)-SEARCH(".",A1)+1))+0) Q2: In B1 enter and copy across: =IF(COLUMN()-1<=LEN($A1),MID($A1,COLUMN()-1,1)+0,"") |
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Posts: 17
|
Thank you both for your responses. I used Aladin's suggestion and it worked perfectly. Big thanks!!
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: May 2002
Location: CT
Posts: 2,895
|
You can use the INT function instead of the ROUNDDOWN function too if you don't have negative numbers.
As far as breaking numbers apart, the formulas are a bit more complicated. Assume you have 54321 in cell A1. B1: (to get the 5) ROUNDDOWN(A1,-4)/10000 C1: ROUNDDOWN(A1,-3)/1000-10*B1 D1: ROUNDDOWN(A1,-2)/100-100*B1-10*C1 E1: ROUNDDOWN(A1,-1)/10-1000*B1-100*C1-10*D1 F1: A1-10000*B1-1000*C1-100*D1-10*E1 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|