+ Reply to Thread
Results 1 to 4 of 4

IFERROR: Aligning text left and right

  1. #1
    Registered User
    Join Date
    04-13-2016
    Location
    ottawa, canada
    MS-Off Ver
    2010
    Posts
    8

    IFERROR: Aligning text left and right

    The formula I am using is

    =IFERROR(INDEX(Data!A:A & " " & Data!B:B,SMALL(IF(Data!$E$1:$E$100="SP",IF(Data!$F$1:$F$100="Ready for Advancement",ROW($A$1:$A$100),""),""),ROW(A1))),"")

    What I'm trying to do is have the first part Data!A:A align to the left and Data!B:B align to the right. I can't think of any way to do this other than using spaces like " ". The problem is I don't want to have to adjust the amount of spaces for every cell manually.

    I have attached an example excel sheet and hope someone can help me.

    Thank you all!
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: IFERROR: Aligning text left and right

    You cannot use formulas for alignment.

    1 (messy) way around this would be to split that formula into 2 parts, then test the length of each part and subtract that from 18 (column B currently allows 18 a's in it - then add that many spaces (using REPT() ). This will mean that you will need to use each part twice
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: IFERROR: Aligning text left and right

    This is really a data layout problem. I suggest you redesign your worksheet to put these two pieces of data in separate columns. I have done this in columns B:G to illustrate.

    Your formulas are not all consistent so I'm not sure they are doing what you want, but this shows the idea of breaking them up into two cells and formatting separately.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: IFERROR: Aligning text left and right

    I think 6 probably has a better approach for this

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 14
    Last Post: 08-01-2013, 06:34 AM
  2. Replies: 5
    Last Post: 12-10-2012, 02:15 PM
  3. Left-aligning certain cells not working??
    By WorldBuilder in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2012, 11:39 AM
  4. [SOLVED] Aligning strings of text
    By crtwrght_mrk in forum Excel General
    Replies: 4
    Last Post: 09-08-2012, 08:28 PM
  5. How to left aligning text in chart (from centered)
    By PhillyT in forum Excel General
    Replies: 2
    Last Post: 01-16-2012, 09:22 AM
  6. Aligning text to the right and left on same line
    By bluerog in forum Word Formatting & General
    Replies: 3
    Last Post: 04-21-2010, 04:49 PM
  7. [SOLVED] Aligning decimal numers to the centre of the cell and aligning dec
    By Ramesh Babu in forum Excel General
    Replies: 1
    Last Post: 07-01-2006, 05:40 PM
  8. [SOLVED] Aligning text
    By Louise in forum Excel General
    Replies: 1
    Last Post: 03-16-2005, 08:06 AM

Tags for this Thread

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