![]() |
![]() |
|
|||||||
| 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: Feb 2002
Location: Robert P. Wagner
Posts: 22
|
Assume a1 value is 59. I need to determine that the number is 50 and 9. Then I will do something using the 50 and then something using the 9... It will always be a two digit number (01 through 59). Thanks
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: =ActiveCell.Address
Posts: 478
|
What you could say is, if A1 = 59, then
=LEFT(A1)*10 will give you 50 =RIGHT(A1) will give you 9. Rgds AJ [ This Message was edited by: AJ on 2002-03-23 08:37 ] |
|
|
|
|
|
#3 |
|
New Member
Join Date: Feb 2002
Location: Robert P. Wagner
Posts: 22
|
Great Aj just did a search and found the left and right but appreciate your help also. I didnt thing about the a1 * 10 for the 50 part.. tks once again
|
|
|
|
|
|
#4 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Chicago, IL USA
Posts: 2,042
|
Hi,
First digit =LEFT(Range,1)*10 Last digit =RIGHT(Range,1)+0 I assume that you handle the leading zeros already. The LEN of the cell value would need to be checked if not. The +0 forces Excel to treat the value as a number, which it wouldn't if the argument cell was text. Regards, Jay |
|
|
|
|
|
#5 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=LEFT(A1,2)+0 =RIGHT(A1)+0 to turn the left and right bits into numbers. Aladin |
|
|
|
|
|
|
#6 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Hi Aladin:
Following up on this thread, rpwagner wants to see the place 10-digit 5 as 50, so your first line would be: =(LEFT(A1)+0)*10, and the 0-place digit then =RIGHT(A1)+0
__________________
Regards! Yogi Anand, D.Eng, P.E. Energy Efficient Building Network LLC www.energyefficientbuild.com |
|
|
|
|
|
#7 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Actually, this works
=LEFT(A1)*10 =RIGHT(A1)+0 The '+0' is just an example math operation, therefor, there's no need to '+0' and then '*10' to get a real number |
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Feb 2002
Location: Calgary, Alberta Canada
Posts: 2,065
|
You state that information is numbers. If they are not text, consider the following: 59 in F2 =INT(F2/10) gives 5 and =MOD(F2,10) gives 9 |
|
|
|
|
|
#9 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
=LEFT(A1)*10 is just right. Aladin |
|
|
|
|
|
|
#10 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Thanks Juan:
You are right -- there is no need to add that 0, even if the original entry was a text entry! |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|