#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 470
Default What are dashes for

I spotted this in a questions and want to know what the dashes are for. I
have also seen dashes used in the SUMPRODUCT function. This is copied &
pasted to show entire question/answer

QUESTION:
=IF(AND(A4="4/12/2006",A4<="9/12/2006"),"49")

This should show next week as 'Week 49' but doesn't. I want to add another
three IF to this string so that I can get the month sorted out in Week order?

ANSWER:
Try it as:
=IF(AND(A4=--"4/12/2006",A4<=--"9/12/2006"),49)

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default What are dashes for

A logical expression returns with TRUE or FALSE (Boolean values); put a
number in A1 and try this formula =A15
When you perform an arithmetic operation on a Boolean Value, Excel treats
TRUE as 1 and FALSE as zero
Try =2*(A15)
So to keep just 1 or zero we could multiple by 1: =1*(A15)
Or we could negate the value twice =-(A15) returns with -1 or 0 while
=--(A15) will return either 1 or 0
In short, the double negation is the more efficient way to coerce Boolean
values to numeric values 1/0
For more read these
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
http://mcgimpsey.com/excel/formulae/doubleneg.html
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"WLMPilot" wrote in message
...
I spotted this in a questions and want to know what the dashes are for. I
have also seen dashes used in the SUMPRODUCT function. This is copied &
pasted to show entire question/answer

QUESTION:
=IF(AND(A4="4/12/2006",A4<="9/12/2006"),"49")

This should show next week as 'Week 49' but doesn't. I want to add
another
three IF to this string so that I can get the month sorted out in Week
order?

ANSWER:
Try it as:
=IF(AND(A4=--"4/12/2006",A4<=--"9/12/2006"),49)



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default What are dashes for

they are double minus signs. used to convert the string into a numeric
value..for example

=--"4/26/2006"
is the same as
=38833

but is more visually understandable.
--
Gary's Student


"WLMPilot" wrote:

I spotted this in a questions and want to know what the dashes are for. I
have also seen dashes used in the SUMPRODUCT function. This is copied &
pasted to show entire question/answer

QUESTION:
=IF(AND(A4="4/12/2006",A4<="9/12/2006"),"49")

This should show next week as 'Week 49' but doesn't. I want to add another
three IF to this string so that I can get the month sorted out in Week order?

ANSWER:
Try it as:
=IF(AND(A4=--"4/12/2006",A4<=--"9/12/2006"),49)

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 623
Default What are dashes for

The dashes are a double minus sign. They are used to convert a string into a
number, by forcing Excel to do arithmetic on it. You could just as easily add 0,
or multiply by 1, with the same result, but the standard has evolved to the
double minuses.

--
Regards,
Fred


"WLMPilot" wrote in message
...
I spotted this in a questions and want to know what the dashes are for. I
have also seen dashes used in the SUMPRODUCT function. This is copied &
pasted to show entire question/answer

QUESTION:
=IF(AND(A4="4/12/2006",A4<="9/12/2006"),"49")

This should show next week as 'Week 49' but doesn't. I want to add another
three IF to this string so that I can get the month sorted out in Week order?

ANSWER:
Try it as:
=IF(AND(A4=--"4/12/2006",A4<=--"9/12/2006"),49)



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
Removing dashes from ISBN's while still keeping 1st number (zero) aprilb Excel Worksheet Functions 3 October 12th 06 06:15 PM
How do I add a 0 and 2 dashes to a truncated soc. sec.# in a cell Allan Excel Discussion (Misc queries) 10 July 7th 06 09:27 PM
Stripping the dashes digital21st Excel Discussion (Misc queries) 4 May 23rd 06 03:43 PM
Dashes in Functions LPS Excel Discussion (Misc queries) 2 January 19th 06 02:38 PM
How to insert a repeating dash in phone numbers without dashes in. LemonLiptonTea New Users to Excel 3 February 5th 05 05:18 PM


All times are GMT +1. The time now is 03:57 AM.

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"