Welcome Guest
Log In | Register )
You last visited December 3, 2016, 10:50 pm
All times shown are
Eastern Time (GMT-5:00)

String formula question.

Topic closed. 3 replies. Last post 7 years ago by KnuckleHead.

Page 1 of 1
PrintE-mailLink
KnuckleHead's avatar - box

United States
Member #73037
April 3, 2009
147 Posts
Offline
Posted: June 16, 2009, 1:10 pm - IP Logged

Morning all,

 

I would like to create a string formula that takes an answer and combines it with a symbol. I'm attempting to see what the differences in the drawn numbers are from different draws.

For example: A recent draw result in - cell B1 = 7. Directly below in cell B2 = 9. If I substract B1 from B2, I get the difference of negative "-2". But if the answer is positive, the answer is "2". How do I take the answer and place the "+" symbol in front of the 2? I know it's a string formula, but I don't know how to format it where I get the "-", or "+" combined with the result.

Would someone please show me how to get the correctly formated answer?

Thanks ahead of time for any assistance...

          The only DUMB question is the one question you DID NOT ask...

    Jack-C's avatar - us
    San Diego, CA
    United States
    Member #61467
    May 24, 2008
    28146 Posts
    Offline
    Posted: June 16, 2009, 1:14 pm - IP Logged

    Select the column, then right click, format cells, special, put in +0.  That will limit it to one digit with the plus sign attached.

      Raven62's avatar - binary
      New Jersey
      United States
      Member #17843
      June 28, 2005
      49642 Posts
      Offline
      Posted: June 16, 2009, 2:52 pm - IP Logged

      Morning all,

       

      I would like to create a string formula that takes an answer and combines it with a symbol. I'm attempting to see what the differences in the drawn numbers are from different draws.

      For example: A recent draw result in - cell B1 = 7. Directly below in cell B2 = 9. If I substract B1 from B2, I get the difference of negative "-2". But if the answer is positive, the answer is "2". How do I take the answer and place the "+" symbol in front of the 2? I know it's a string formula, but I don't know how to format it where I get the "-", or "+" combined with the result.

      Would someone please show me how to get the correctly formated answer?

      Thanks ahead of time for any assistance...

      [Cell B1=7 Cell B2=9 Cell C2=-2] [Cell B1=9 Cell B2=7 Cell C2=+2]

      Cell C2=@IF(B1-B2>-1,"+"&@STRING(B1-B2,0),@STRING(B1-B2,0))

      A mind once stretched by a new idea never returns to its original dimensions!

        KnuckleHead's avatar - box

        United States
        Member #73037
        April 3, 2009
        147 Posts
        Offline
        Posted: June 16, 2009, 3:57 pm - IP Logged

        Thank you both Jack-C and Raven62,

        Jack-C, I tried your suggestion, but, I don't have that capability in my spreadsheet.

        I did try your example Raven62, and it worked. All I have to do now is expand it to several "@IF's" to get the desired answer for any "+", "-", or "=" number situation.

        Wish I had your know-how Raven62, It'd be a whole lot easier putting this together.

        Thank you again...

                  The only DUMB question is the one question you DID NOT ask...