diagonal cell split

scoopypaw

New Member
Joined
May 4, 2005
Messages
2
Hello,
Is there a way to split a cell diagonally ? I would like to have 2 data points in a cell that have a diagonal split so it looks like that are still in the same cell with just a diagonal line between them. I also need to be able to still sum the 2 data points. :rolleyes:

Thanks
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
I know this is possible. I read about it once in the Journal of Accounting. Unfortunately, I don't remember how it's done. I thought it was a simple formatting procedure.

You can format a cell to have a diagonal line split via Format / Cells / Border.

But how you get your text or data divided into the two halves of that cell, I haven't figured out yet ...

good luck
 
Upvote 0
sschwantes

Yes you can format the cell with a diagonal line but (as far as I'm aware) a cell can only hold 1 piece of data at a time.
 
Upvote 0
Why not use three cells?

One for the numerator, one with "/", and one with the denominator?

If you make the columns thin enough, it will probably be aesthetically similar.
 
Upvote 0
If it were only for show, I'd put in a diagonal border, set cell wrapping on and use ALT-ENTER between the 1st number and the 2nd number. You will need to add spaces between the ALT-ENTER and your number to get the spacing correct.
 
Upvote 0
Thanks for all the suggestions. I need to be able to calculate the cells as well. So I just decided to organize the spreadsheet a different way.

However if anyone thinks of away to spilt a cell diagonally that can still be calculated, please share :biggrin:

Thanks again
 
Upvote 0
On the lines of what Oaktree suggested, there are several ways of making it look like it is separated that way but not of making one cell behave like two.

Oaktree's suggestion is probably the easiest, but if you want to go a VBA route, you could use one cell and via code place the results of your calculations on Labels or borderless textboxes placed atop the cell with a diagonal border format.
 
Upvote 0
Oaktree said:
Why not use three cells?

One for the numerator, one with "/", and one with the denominator?

If you make the columns thin enough, it will probably be aesthetically similar.

Or use two cells and add a diagonal line from Autoshapes.
 
Upvote 0
scoopypaw said:
Hello,
Is there a way to split a cell diagonally ? I would like to have 2 data points in a cell that have a diagonal split so it looks like that are still in the same cell with just a diagonal line between them. I also need to be able to still sum the 2 data points.
Yes this is possible but you really ought to consider changing your workbook design because it is more trouble than it's worth to maintain.

Expanding on Seti's approach, here are the steps, assuming cell A1, and data points of 5 and 8 - -

Step 1
In cell A1, enter "58" (without the quotes).

Step 2
Select cell A1, and in the formula bar place the cursor beteewn the 5 and the 8.

Step 3
Press Alt+Enter twice .

Step 4
Press Ctrl+Enter, which will accept the changes and keep cell A1 active.

Step 5
From the worksheet menu, click Format > Cells > Border tab.

Step 6
Select the left diagonal border. That is, select the border that extends from the upper left corner to the lower right corner.

Step 7
While still in the Format Cells dialog, select the Alignment tab, and for both the Horizontal and Vertical text alignment fields, select "Justify".

Step 8
Click OK to exit the Format Cells dialog.

Step 9
Place your cursor in the formula bar again at the beginning of the value so it is before the 5, and hit the spacebar as many times as necessary (depending on column width) to have that 5 character be in the upper right half of the cell.

Step 10
At this point the cell looks the way you want it to, so now we need to parse the two values so you can use them in calculations.

Step 10a
Worksheet formulas:

X coordinate
=LEFT(SUBSTITUTE(TRIM($A$1),CHAR(10),"")-1)+0

Y coordinate
=RIGHT($A$1,1)+0


or


Step 10b
Here is a VBA approach so you can use the variables in VBA calculations:

Sub Test1()
Dim MyStr$, Xcoor$, Ycoor$
MyStr = Application.Substitute(Range("A1"), " ", "")
Xcoor = Mid(MyStr, 1, Len(MyStr) - 3)
Ycoor = Right(Range("A1"), 1)
MsgBox _
"X coordinate: " & Xcoor & vbCrLf & _
"Y coordinate: " & Ycoor
End Sub



This is probably not bulletproof and as I said, you'd be better off using separate cells, but it's one possible thought process in addition to the preceding responses to your question.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top