ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   cell info (https://www.excelbanter.com/excel-worksheet-functions/5981-cell-info.html)

Jo

cell info
 
thanks that works great, however the return does not seem to be a number
if the answer is 123 I cannot then use it in a formula

If I have "123456789" in a cell I wish to copy specifc parts of it to other
cells
i.e.
A1 first 3 - 123
A2 second 3 - 456
A3 third 3 - 789
How can I do this both in a worksheet and using VBA.
Thanks
Jo


Ken

Jo, if you enter "123456789" in A1, "=LEFT(A1,3)" in B1, and "=B1*2" in C1,
what do you get returned in C1?

"Jo" wrote:

thanks that works great, however the return does not seem to be a number
if the answer is 123 I cannot then use it in a formula

If I have "123456789" in a cell I wish to copy specifc parts of it to other
cells
i.e.
A1 first 3 - 123
A2 second 3 - 456
A3 third 3 - 789
How can I do this both in a worksheet and using VBA.
Thanks
Jo


Jo

this works, but does not work in my nested if function
the if function is fine if I type 123 in
thanks
Jo

"Ken" wrote:

Jo, if you enter "123456789" in A1, "=LEFT(A1,3)" in B1, and "=B1*2" in C1,
what do you get returned in C1?

"Jo" wrote:

thanks that works great, however the return does not seem to be a number
if the answer is 123 I cannot then use it in a formula

If I have "123456789" in a cell I wish to copy specifc parts of it to other
cells
i.e.
A1 first 3 - 123
A2 second 3 - 456
A3 third 3 - 789
How can I do this both in a worksheet and using VBA.
Thanks
Jo


Ken

Jo, sorry, but I don't follow you exactly.
Could you tell me exctly what you have in which cells so I can replicate it
and try to help further? You say you have a nested if function somewhere?

"Jo" wrote:

this works, but does not work in my nested if function
the if function is fine if I type 123 in
thanks
Jo

"Ken" wrote:

Jo, if you enter "123456789" in A1, "=LEFT(A1,3)" in B1, and "=B1*2" in C1,
what do you get returned in C1?

"Jo" wrote:

thanks that works great, however the return does not seem to be a number
if the answer is 123 I cannot then use it in a formula

If I have "123456789" in a cell I wish to copy specifc parts of it to other
cells
i.e.
A1 first 3 - 123
A2 second 3 - 456
A3 third 3 - 789
How can I do this both in a worksheet and using VBA.
Thanks
Jo


RagDyer

Try this:

=--Left(A1,3)
=--RIGHT(A1,3)
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"Jo" wrote in message
...
this works, but does not work in my nested if function
the if function is fine if I type 123 in
thanks
Jo

"Ken" wrote:

Jo, if you enter "123456789" in A1, "=LEFT(A1,3)" in B1, and "=B1*2" in

C1,
what do you get returned in C1?

"Jo" wrote:

thanks that works great, however the return does not seem to be a number
if the answer is 123 I cannot then use it in a formula

If I have "123456789" in a cell I wish to copy specifc parts of it to

other
cells
i.e.
A1 first 3 - 123
A2 second 3 - 456
A3 third 3 - 789
How can I do this both in a worksheet and using VBA.
Thanks
Jo



kraljb


The reason it is not working in your nested if function is that the
left, right, and mid fuctions all treat it as text. You would have to
do the following to use it in your if function as a number.

=LEFT($A$1, 3)*1
=MID($A$1,4,3)*1
=RIGHT($A$1,3)*1


--
kraljb
------------------------------------------------------------------------
kraljb's Profile: http://www.excelforum.com/member.php...fo&userid=9955
View this thread: http://www.excelforum.com/showthread...hreadid=276446


Jo

it's okay missed "" off the if statement, 789 should have been "789"

"Ken" wrote:

Jo, sorry, but I don't follow you exactly.
Could you tell me exctly what you have in which cells so I can replicate it
and try to help further? You say you have a nested if function somewhere?

"Jo" wrote:

this works, but does not work in my nested if function
the if function is fine if I type 123 in
thanks
Jo

"Ken" wrote:

Jo, if you enter "123456789" in A1, "=LEFT(A1,3)" in B1, and "=B1*2" in C1,
what do you get returned in C1?

"Jo" wrote:

thanks that works great, however the return does not seem to be a number
if the answer is 123 I cannot then use it in a formula

If I have "123456789" in a cell I wish to copy specifc parts of it to other
cells
i.e.
A1 first 3 - 123
A2 second 3 - 456
A3 third 3 - 789
How can I do this both in a worksheet and using VBA.
Thanks
Jo



All times are GMT +1. The time now is 10:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com