+ Reply to Thread
Results 1 to 8 of 8

Need long space, dots or dashes b/w two values

Hybrid View

  1. #1
    Registered User
    Join Date
    11-07-2011
    Location
    Pakistan
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    33

    Need long space, dots or dashes b/w two values

    hi guys,
    I am working on a sheet but I have a problem. I need a formula which show a line, dots or long space between two values.
    If
    A=ABC, B=100, C=2, D=2 & E=IF(C1=D1,A1&B1,"") which gives the result as ABC100 but I want
    ABC..............100 or
    ABC--------------100 or
    ABC 100

    sample sheet is attached.
    help please
    Attached Files Attached Files
    Last edited by fassi; 11-24-2011 at 07:00 PM.
    **fassi**

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Need long space, dots or dashes b/w two values

    Try:

    =IF(D1=C1,A1&REPT(".",10)&B1,"")


    replace the 10 in REPT(".",10) with number of dots (or other character) you want.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    11-07-2011
    Location
    Pakistan
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    33

    Re: Need long space, dots or dashes b/w two values

    Excellent....thank you so much NBVC

  4. #4
    Registered User
    Join Date
    11-07-2011
    Location
    Pakistan
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    33

    Re: Need long space, dots or dashes b/w two values

    Quote Originally Posted by NBVC View Post
    Try:

    =IF(D1=C1,A1&REPT(".",10)&B1,"")


    replace the 10 in REPT(".",10) with number of dots (or other character) you want.
    need some help on that formula
    if cells A1 & B1 are empty, this formula shows 0 value. I want that if A1 and B1 are empty then E1 should empty also.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Need long space, dots or dashes b/w two values

    tRY:

    =IF(D1=C1,IF(AND(A1="",B1=""),"",A1&REPT(".",10)&B1),"")

  6. #6
    Registered User
    Join Date
    11-07-2011
    Location
    Pakistan
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    33

    Re: Need long space, dots or dashes b/w two values

    Quote Originally Posted by NBVC View Post
    tRY:

    =IF(D1=C1,IF(AND(A1="",B1=""),"",A1&REPT(".",10)&B1),"")

    this formula works perfect but in my sheet values in A1 and B1 are coming from other source and these cells are formatted as <Custom.....0;-0;;@> to hide zero value of these cells and this formula shows E1 value 0 not empty.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Need long space, dots or dashes b/w two values

    How about?

    =IF(D1=C1,IF(SUM(A1,B1)=0,"",A1&REPT(".",10)&B1),"")

  8. #8
    Registered User
    Join Date
    11-07-2011
    Location
    Pakistan
    MS-Off Ver
    Microsoft Excel 2007
    Posts
    33

    Thumbs up Re: Need long space, dots or dashes b/w two values

    Quote Originally Posted by NBVC View Post
    How about?

    =IF(D1=C1,IF(SUM(A1,B1)=0,"",A1&REPT(".",10)&B1),"")
    WOW its amazing, works like magic.....thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1