Numbers column alignment

How do I get the columns to align by the number inside them..

ie if column A has the numbers 1,2, 3, 5, 10 and column B has 2, 4, 7, 8, 10 how do I make column be look like bank, 2 , blank, 4, blank , 7, 8 10 so they are aligned (im trying to match RFID's so 15 digit numbers and most should be duplicated between the two rows, but some wont be )


MacBook Pro 13″, macOS 12.5

Posted on Jul 11, 2023 5:21 PM

Reply
6 replies

Jul 12, 2023 12:53 AM in response to ruffy230

Hi Ruffy,


The numbers in your example are aligned right. Each number, no matter how many digits it has, is displayed with its last digit placed close to the right boundary of the cell it occupies.


If you want the numbers in your table aligned to start at the left edge of the cells (in the same manner as words and other text is aligned) you can select the cells where that is to happen, then click the format brush to open the Format pane, click Text, then click the leftmost section of the Alignment bar (below 'text colour' in the diagram).

The content of all selected cells will jump to the left and align themselves close to the left boundary of their cell, as seen in the image below.



ruffy230 wrote:

How do I get the columns to align by the number inside them..
ie if column A has the numbers 1,2, 3, 5, 10 and column B has 2, 4, 7, 8, 10 how do I make column be look like bank, 2 , blank, 4, blank , 7, 8 10 so they are aligned (im trying to match RFID's so 15 digit numbers and most should be duplicated between the two rows, but some wont be )
https://discussions.apple.com/content/attachment/83964359-487a-4b22-ad31-6d9c564f2a67

Regards,

Barry

Jul 13, 2023 12:06 PM in response to ruffy230

I think I see what you are trying to do and its the wording that is causing a misunderstanding I think.

Alignment in spreadsheets means is the text in the cell moved left or right in the cell.


I think what you are trying to say is that you want to have all the 1'a show in the first row if one exists for that year. 2;s are in the second row. and if it does exist in that year, it should be blank.


I dont even know how you would explain that better with a single word, so alignment does kinda work, just not when used where that is used to describe something else in the program.


am I close? if so then I think SGIII has the right path... use one data table and a separate table for displaying your data the way you want.


Jason


Jul 12, 2023 8:12 AM in response to ruffy230

Are you looking for something like this?




If so, here's how you can do this.


  1. Set up a separate table.
  2. Use the SMALL function to list all the values from both columns of the original table in ascending order.
  3. Filter for 'is distinct' to hide the duplicates in Column A
  4. Use XLOOKUP to retrieve the values for each column.
  5. If you need the data without the rows hidden by the filter simply select the visible cells, command-c to copy, click once in the cell of an existing target table, and command-v to paste.


The formula in A2, filled down:


=SMALL(Table 1::$A$2:$B$6,ROW()−1)


The formula in B2, filled down and right:


=XLOOKUP($A2,Table 1::A,Table 1::A,"")


Replace the , in the formulas with ; if your region uses , as the decimal separator.


SG



Jul 13, 2023 4:53 PM in response to ruffy230

ruffy230 wrote:


have to re read the comment by SGill. I looked over it and my non spreadsheet brain was exploding,


It wasn't really a "comment."😀 It was a fully worked example with step-by-step instructions that take a few minutes to follow. Anyway, glad you have found a solution, in a comment on my example. Don't hesitate to post if you haven't fully solved your problem. It wasn't an easy one! And it appears to be quite common, as you will see from a web search for data alignment in two excel columns.


SG

Numbers column alignment

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.