Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default CONCATENATE zeros

I am trying to calculate only change and not dollars and then see if
the change balances...

This works….

K6 = 4
Q:12 sum(A1:A12) - this yields $10.40
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 4
Q14 =IF(K6<Q13,"Balance","Out") this yields Balance

BUT

This does not with whole numbers…
K6 = 0
Q:12 sum(A1:A12) - this yields $16.00
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 6
Q14 =IF(K6<Q13,"Balance","Out") this yields Out where it should
balance as there are no cents.


It seems that Excel does not seeing zero cents and thus jumps a
decimal place.

Any help anyone could give me would be greatly appreciated!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default CONCATENATE zeros

Hi,

Your using text manipulation to work on numbers try these formula instead

Q13 =(Q12-INT(Q12))*10
Q14 =IF(K6=Q13,"Balance","Out")

Mike

"Bullocks" wrote:

I am trying to calculate only change and not dollars and then see if
the change balances...

This works€¦.

K6 = 4
Q:12 sum(A1:A12) - this yields $10.40
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 4
Q14 =IF(K6<Q13,"Balance","Out") this yields Balance

BUT

This does not with whole numbers€¦
K6 = 0
Q:12 sum(A1:A12) - this yields $16.00
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 6
Q14 =IF(K6<Q13,"Balance","Out") this yields Out where it should
balance as there are no cents.


It seems that Excel does not seeing zero cents and thus jumps a
decimal place.

Any help anyone could give me would be greatly appreciated!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default CONCATENATE zeros

On Jul 7, 3:47*pm, Mike H wrote:
Hi,

Your using text manipulation to work on numbers try these formula instead

Q13 *=(Q12-INT(Q12))*10
Q14 *=IF(K6=Q13,"Balance","Out")

Mike



"Bullocks" wrote:
I am trying to calculate only change and not dollars and then see if
the change balances...


This works….


K6 = 4
Q:12 sum(A1:A12) *- this yields $10.40
Q13 =CONCATENATE(RIGHT(Q12,1)) *- this yields the 4
Q14 =IF(K6<Q13,"Balance","Out") this yields *Balance


BUT


This does not with whole numbers…
K6 = 0
Q:12 sum(A1:A12) *- this yields $16.00
Q13 =CONCATENATE(RIGHT(Q12,1)) *- this yields the 6
Q14 =IF(K6<Q13,"Balance","Out") this yields *Out where it should
balance as there are no cents.


It seems that Excel does not seeing zero cents and thus jumps a
decimal place.


Any help anyone could give me would be greatly appreciated!- Hide quoted text -


- Show quoted text -


Fantastic! Thank you soooooo much.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default CONCATENATE zeros

On Jul 7, 4:57*pm, Bullocks wrote:
On Jul 7, 3:47*pm, Mike H wrote:





Hi,


Your using text manipulation to work on numbers try these formula instead


Q13 *=(Q12-INT(Q12))*10
Q14 *=IF(K6=Q13,"Balance","Out")


Mike


"Bullocks" wrote:
I am trying to calculate only change and not dollars and then see if
the change balances...


This works….


K6 = 4
Q:12 sum(A1:A12) *- this yields $10.40
Q13 =CONCATENATE(RIGHT(Q12,1)) *- this yields the 4
Q14 =IF(K6<Q13,"Balance","Out") this yields *Balance


BUT


This does not with whole numbers…
K6 = 0
Q:12 sum(A1:A12) *- this yields $16.00
Q13 =CONCATENATE(RIGHT(Q12,1)) *- this yields the 6
Q14 =IF(K6<Q13,"Balance","Out") this yields *Out where it should
balance as there are no cents.


It seems that Excel does not seeing zero cents and thus jumps a
decimal place.


Any help anyone could give me would be greatly appreciated!- Hide quoted text -


- Show quoted text -


Fantastic! Thank you soooooo much.- Hide quoted text -

- Show quoted text -


Argh... spoke to soon. The magic numer 38.90 does not work. Every
other number I tried has without fail but this one. Even when I mess
with the number it is being balanced against... from 0-9 it aways
reads "out". Strange.
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default CONCATENATE zeros

"Bullocks" wrote:
I am trying to calculate only change and not dollars
and then see if the change balances


So let's work with the example 12.34 in Q12 and make sure the solution does
exactly what you intend. Frankly, that is unclear to me from your example.


K6 = 4
Q:12 sum(A1:A12) - this yields $10.40
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 4
Q14 =IF(K6<Q13,"Balance","Out") this yields Balance


One approach:

Q13: =mod(round(Q12*100,0),100)
Q14: =if(K6=Q13, "balances", "does not balance")

Note: That assumes that K6 is 34 in my example; 40, not 4, in your example.

If you are truly trying to limit the comparison to only the tenths digit,
please post back with that clarification, and we can adjust my solution.


"Bullocks" wrote:
On Jul 7, 3:47 pm, Mike H wrote:
Q13 =(Q12-INT(Q12))*10
Q14 =IF(K6=Q13,"Balance","Out")

[....]
The magic numer 38.90 does not work.


Because Mike forgot that the internal representation of decimal fractions is
not always what they appear to be. We should always use ROUND diligently.

((Q12-INT(Q12))*10 is really about 8.99999999999999.

Applying Mike's solution -- just another way to write MOD, albeit more
reliable for some numbers -- to my assumption (you want to compare cents, as
you say, not just the tenths digit):

Q13: =round((Q12-int(Q12)*100,0)
Q14: =if(K6=Q13, "balances", "does not balance")


----- original message -----

"Bullocks" wrote in message
...
On Jul 7, 4:57 pm, Bullocks wrote:
On Jul 7, 3:47 pm, Mike H wrote:
Hi,


Your using text manipulation to work on numbers try these formula
instead


Q13 =(Q12-INT(Q12))*10
Q14 =IF(K6=Q13,"Balance","Out")


Mike


"Bullocks" wrote:
I am trying to calculate only change and not dollars and then see if
the change balances...


This works….


K6 = 4
Q:12 sum(A1:A12) - this yields $10.40
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 4
Q14 =IF(K6<Q13,"Balance","Out") this yields Balance


BUT


This does not with whole numbers…
K6 = 0
Q:12 sum(A1:A12) - this yields $16.00
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 6
Q14 =IF(K6<Q13,"Balance","Out") this yields Out where it should
balance as there are no cents.


It seems that Excel does not seeing zero cents and thus jumps a
decimal place.


Any help anyone could give me would be greatly appreciated!- Hide
quoted text -


- Show quoted text -


Fantastic! Thank you soooooo much.- Hide quoted text -

- Show quoted text -


Argh... spoke to soon. The magic numer 38.90 does not work. Every
other number I tried has without fail but this one. Even when I mess
with the number it is being balanced against... from 0-9 it aways
reads "out". Strange.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default CONCATENATE zeros

On Jul 7, 8:33*pm, "JoeU2004" wrote:
"Bullocks" wrote:
I am trying to calculate only change and not dollars
and then see if the change balances


So let's work with the example 12.34 in Q12 and make sure the solution does
exactly what you intend. *Frankly, that is unclear to me from your example.

K6 = 4
Q:12 sum(A1:A12) *- this yields $10.40
Q13 =CONCATENATE(RIGHT(Q12,1)) *- this yields the 4
Q14 =IF(K6<Q13,"Balance","Out") this yields *Balance


One approach:

Q13: *=mod(round(Q12*100,0),100)
Q14: *=if(K6=Q13, "balances", "does not balance")

Note: *That assumes that K6 is 34 in my example; 40, not 4, in your example.

If you are truly trying to limit the comparison to only the tenths digit,
please post back with that clarification, and we can adjust my solution.

"Bullocks" wrote:
On Jul 7, 3:47 pm, Mike H wrote:
Q13 =(Q12-INT(Q12))*10
Q14 =IF(K6=Q13,"Balance","Out")

[....]
The magic numer 38.90 does not work.


Because Mike forgot that the internal representation of decimal fractions is
not always what they appear to be. *We should always use ROUND diligently.

((Q12-INT(Q12))*10 is really about 8.99999999999999.

Applying Mike's solution -- just another way to write MOD, albeit more
reliable for some numbers -- to my assumption (you want to compare cents, as
you say, not just the tenths digit):

Q13: *=round((Q12-int(Q12)*100,0)
Q14: *=if(K6=Q13, "balances", "does not balance")

----- original message -----

"Bullocks" wrote in message

...
On Jul 7, 4:57 wrote:





On Jul 7, 3:47 pm, Mike H wrote:
Hi,


Your using text manipulation to work on numbers try these formula
instead


Q13 =(Q12-INT(Q12))*10
Q14 =IF(K6=Q13,"Balance","Out")


Mike


"Bullocks" wrote:
I am trying to calculate only change and not dollars and then see if
the change balances...


This works….


K6 = 4
Q:12 sum(A1:A12) - this yields $10.40
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 4
Q14 =IF(K6<Q13,"Balance","Out") this yields Balance


BUT


This does not with whole numbers…
K6 = 0
Q:12 sum(A1:A12) - this yields $16.00
Q13 =CONCATENATE(RIGHT(Q12,1)) - this yields the 6
Q14 =IF(K6<Q13,"Balance","Out") this yields Out where it should
balance as there are no cents.


It seems that Excel does not seeing zero cents and thus jumps a
decimal place.


Any help anyone could give me would be greatly appreciated!- Hide
quoted text -


- Show quoted text -


Fantastic! Thank you soooooo much.- Hide quoted text -


- Show quoted text -


Argh... spoke to soon. *The magic numer 38.90 does not work. *Every
other number I tried has without fail but this one. *Even when I mess
with the number it is being balanced against... from 0-9 it aways
reads "out". *Strange.- Hide quoted text -

- Show quoted text -


Many thanks again!

What if I now did only want the 10ths? Eg. I had $38.24 and I only
wated to balance the .2 with a 2.

Cheers!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate with leading zeros Nikki Excel Worksheet Functions 2 August 4th 08 11:05 PM
How can I concatenate text with leading zeros Dick Excel Worksheet Functions 2 January 31st 08 06:36 PM
Concatenate Text & Numbers Keeping zeros.. glynny Excel Worksheet Functions 3 February 17th 06 10:10 AM
Concatenate and keep preceeding zeros Wrkn4alivn Excel Worksheet Functions 2 February 16th 06 11:32 PM
save text field w/ leading zeros in .csv format & not lose zeros? Ques Excel Discussion (Misc queries) 1 May 4th 05 06:21 PM


All times are GMT +1. The time now is 03:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"