Microsoft® Excel® based database addin

 

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Steve Guest

    Default left/right or center ?

    I have days off in the P column in this format: Sat/Sun
    I'm using them in another column in this format SatSun, so I'm using this
    formula:
    =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    However, I have some days off that just have Sun, which produces SunSun.
    How can the formula be writen to produce SatSun when two days are showing,
    and only Sun when one day is showing ?

    Thanks,

    Steve

  2. #2
    Fred Smith Guest

    Default Re: left/right or center ?

    Use Substitute, as in:
    =Substitute(P21,"/","")

    Regards,
    Fred

    "Steve" <Steve@discussions.microsoft.com> wrote in message
    news1729A01-069B-4F49-BE64-678E1C6E3788@microsoft.com...
    >I have days off in the P column in this format: Sat/Sun
    > I'm using them in another column in this format SatSun, so I'm using this
    > formula:
    > =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    > However, I have some days off that just have Sun, which produces SunSun.
    > How can the formula be writen to produce SatSun when two days are showing,
    > and only Sun when one day is showing ?
    >
    > Thanks,
    >
    > Steve



  3. #3
    Glenn Guest

    Default Re: left/right or center ?

    Steve wrote:
    > I have days off in the P column in this format: Sat/Sun
    > I'm using them in another column in this format SatSun, so I'm using this
    > formula:
    > =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    > However, I have some days off that just have Sun, which produces SunSun.
    > How can the formula be writen to produce SatSun when two days are showing,
    > and only Sun when one day is showing ?
    >
    > Thanks,
    >
    > Steve


    =IF(LEN(P21)=7,LEFT(P21,3)&RIGHT(P21,3),P21)

  4. #4
    Glenn Guest

    Default Re: left/right or center ?

    Yes, much better!

    Fred Smith wrote:
    > Use Substitute, as in:
    > =Substitute(P21,"/","")
    >
    > Regards,
    > Fred
    >
    > "Steve" <Steve@discussions.microsoft.com> wrote in message
    > news1729A01-069B-4F49-BE64-678E1C6E3788@microsoft.com...
    >> I have days off in the P column in this format: Sat/Sun
    >> I'm using them in another column in this format SatSun, so I'm using this
    >> formula:
    >> =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    >> However, I have some days off that just have Sun, which produces SunSun.
    >> How can the formula be writen to produce SatSun when two days are
    >> showing,
    >> and only Sun when one day is showing ?
    >>
    >> Thanks,
    >>
    >> Steve

    >


  5. #5
    ker_01 Guest

    Default RE: left/right or center ?

    =if(len(P21)>3,LEFT(P21,3)&RIGHT(P21,3),P21)

    Assumes that cell P21 has nothing in it but either Sat, Sun, or Sat...Sun

    HTH,
    Keith

    "Steve" wrote:

    > I have days off in the P column in this format: Sat/Sun
    > I'm using them in another column in this format SatSun, so I'm using this
    > formula:
    > =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    > However, I have some days off that just have Sun, which produces SunSun.
    > How can the formula be writen to produce SatSun when two days are showing,
    > and only Sun when one day is showing ?
    >
    > Thanks,
    >
    > Steve


  6. #6
    Steve Guest

    Default RE: left/right or center ?

    Thanks,

    Works great, but I'm getting zeros now in the cells when there is nothing in
    the P column cells, which is a lot. How can I eleminate the zeros if nothing
    is in the P column cell ?

    "ker_01" wrote:

    > =if(len(P21)>3,LEFT(P21,3)&RIGHT(P21,3),P21)
    >
    > Assumes that cell P21 has nothing in it but either Sat, Sun, or Sat...Sun
    >
    > HTH,
    > Keith
    >
    > "Steve" wrote:
    >
    > > I have days off in the P column in this format: Sat/Sun
    > > I'm using them in another column in this format SatSun, so I'm using this
    > > formula:
    > > =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    > > However, I have some days off that just have Sun, which produces SunSun.
    > > How can the formula be writen to produce SatSun when two days are showing,
    > > and only Sun when one day is showing ?
    > >
    > > Thanks,
    > >
    > > Steve


  7. #7
    Steve Guest

    Default Re: left/right or center ?

    Thanks,

    Works great, but I'm getting zeros now in the cells when there is nothing in
    the P column cells, which is a lot. How can I eleminate the zeros if nothing
    is in the P column cell ?


    "Glenn" wrote:

    > Steve wrote:
    > > I have days off in the P column in this format: Sat/Sun
    > > I'm using them in another column in this format SatSun, so I'm using this
    > > formula:
    > > =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    > > However, I have some days off that just have Sun, which produces SunSun.
    > > How can the formula be writen to produce SatSun when two days are showing,
    > > and only Sun when one day is showing ?
    > >
    > > Thanks,
    > >
    > > Steve

    >
    > =IF(LEN(P21)=7,LEFT(P21,3)&RIGHT(P21,3),P21)
    > .
    >


  8. #8
    Steve Guest

    Default Re: left/right or center ?

    I don't understand where to put this in my regular formula.
    Thanks,

    Steve

    "Fred Smith" wrote:

    > Use Substitute, as in:
    > =Substitute(P21,"/","")
    >
    > Regards,
    > Fred
    >
    > "Steve" <Steve@discussions.microsoft.com> wrote in message
    > news1729A01-069B-4F49-BE64-678E1C6E3788@microsoft.com...
    > >I have days off in the P column in this format: Sat/Sun
    > > I'm using them in another column in this format SatSun, so I'm using this
    > > formula:
    > > =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    > > However, I have some days off that just have Sun, which produces SunSun.
    > > How can the formula be writen to produce SatSun when two days are showing,
    > > and only Sun when one day is showing ?
    > >
    > > Thanks,
    > >
    > > Steve

    >
    > .
    >


  9. #9
    Glenn Guest

    Default Re: left/right or center ?

    It doesn't go in your regular formula, it replaces it.

    Steve wrote:
    > I don't understand where to put this in my regular formula.
    > Thanks,
    >
    > Steve
    >
    > "Fred Smith" wrote:
    >
    >> Use Substitute, as in:
    >> =Substitute(P21,"/","")
    >>
    >> Regards,
    >> Fred
    >>
    >> "Steve" <Steve@discussions.microsoft.com> wrote in message
    >> news1729A01-069B-4F49-BE64-678E1C6E3788@microsoft.com...
    >>> I have days off in the P column in this format: Sat/Sun
    >>> I'm using them in another column in this format SatSun, so I'm using this
    >>> formula:
    >>> =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    >>> However, I have some days off that just have Sun, which produces SunSun.
    >>> How can the formula be writen to produce SatSun when two days are showing,
    >>> and only Sun when one day is showing ?
    >>>
    >>> Thanks,
    >>>
    >>> Steve

    >> .
    >>


  10. #10
    Steve Guest

    Default Re: left/right or center ?

    Duh!!

    I guess it helps if I spell SUBSTITUTE correctly.

    Thanks,

    Steve

    "Glenn" wrote:

    > It doesn't go in your regular formula, it replaces it.
    >
    > Steve wrote:
    > > I don't understand where to put this in my regular formula.
    > > Thanks,
    > >
    > > Steve
    > >
    > > "Fred Smith" wrote:
    > >
    > >> Use Substitute, as in:
    > >> =Substitute(P21,"/","")
    > >>
    > >> Regards,
    > >> Fred
    > >>
    > >> "Steve" <Steve@discussions.microsoft.com> wrote in message
    > >> news1729A01-069B-4F49-BE64-678E1C6E3788@microsoft.com...
    > >>> I have days off in the P column in this format: Sat/Sun
    > >>> I'm using them in another column in this format SatSun, so I'm using this
    > >>> formula:
    > >>> =LEFT(P21,3)&RIGHT(P21,3), which produces SatSun
    > >>> However, I have some days off that just have Sun, which produces SunSun.
    > >>> How can the formula be writen to produce SatSun when two days are showing,
    > >>> and only Sun when one day is showing ?
    > >>>
    > >>> Thanks,
    > >>>
    > >>> Steve
    > >> .
    > >>

    > .
    >


Similar Threads

  1. Center Comments on Center of Screen
    By Raymond W. in forum Miscellaneous Excel Subjects
    Replies: 5
    Last Post: 09-15-2009, 04:18 PM
  2. Merge and Center and Center Accross Selection
    By Bojingles03 in forum New Excel Users Forum
    Replies: 3
    Last Post: 03-17-2009, 08:59 PM
  3. How can I Left justify the center section of the print header?
    By abohlin in forum Programming (VBA, VB, C# etc)
    Replies: 2
    Last Post: 03-02-2009, 03:00 AM
  4. Align to the left or to the right (or center)
    By kaokao1 in forum Programming (VBA, VB, C# etc)
    Replies: 2
    Last Post: 01-29-2009, 02:26 PM
  5. Want to use left and center footer in same page
    By wjs-matt in forum Charting
    Replies: 2
    Last Post: 01-16-2009, 03:28 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts