Add multiple spaces in a cell

Rav_Singh

New Member
Joined
Jun 29, 2019
Messages
28
I hope someone can assist with what seems a simple formula that I have failed to grasp.

In the example below I would like to add spaces before a value in a cell depending upon the value in another cell.

Example:

Column A - Text
Monday
Tuesday
Wednesday

Column B - Number of Spaces
2
4
6

Column C - (How the data should hopefully look)
__Monday (2 spaces before text)
____Tuesday (4 spaces before text)
______Wednesday (6 spaces before text)

If anyone can assist that will be greatly appreciated.


Rav
 
Last edited:

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Code:
=rept(" ",b1)&a1
 
Last edited:
Upvote 0
Copy C2 down. May not look like it does on my worksheet, but the spaces are there as confirmed in col D.
Excel Workbook
ABCD
2Monday2Monday8
3Tuesday4 Tuesday11
4Wednesday6 Wednesday15
Sheet1





 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,501
Messages
6,125,169
Members
449,212
Latest member
kenmaldonado

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