- #1

- 228

- 3

I have seen many posts teaching people how to add new rows but adding new column seems quite a different thing since the columns are named by letters instead of numbers.

Thank you.

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

In summary, you can use MATLAB to append new columns into existing excel files without altering the original data. You can also use MATLAB to append new rows to existing excel files. Finally, you can solve the problem using a combination of MATLAB and xlswrite.

- #1

- 228

- 3

I have seen many posts teaching people how to add new rows but adding new column seems quite a different thing since the columns are named by letters instead of numbers.

Thank you.

Physics news on Phys.org

- #2

Mentor

- 14,708

- 9,045

and from MATLAB a similar approach:

https://www.mathworks.com/matlabcentral/newsreader/view_thread/274697

and using xlswrite in matlab:

http://www.mathworks.com/matlabcent...y-matlab-matrix-when-i-write-it-to-excel-in-m

- #3

- 228

- 3

jedishrfu said:

and from MATLAB a similar approach:

https://www.mathworks.com/matlabcentral/newsreader/view_thread/274697

and using xlswrite in matlab:

http://www.mathworks.com/matlabcent...y-matlab-matrix-when-i-write-it-to-excel-in-m

Finally I solve it in the following way:

if (step==1)

xlswrite(filename,array,sheetname,'A1'); %Create the file

else

[~,~,Data]=xlsread(filename,sheetname); %read in all the old data

OriCol=size(Data,2); %get the column number of the old data

NewCol=OriCol+1; %the new array is placed right next to the original data

ColLetter=xlcolumnletter(NewCol);

StartCell=[ColLetter,'1'];

xlswrite(filename,array,sheetname,StartCell);

end

The xlcolumnletter function is found here:

http://www.mathworks.com/matlabcentral/answers/54153-dynamic-ranges-using-xlswrite

The process for appending new columns into an Excel spreadsheet is fairly simple. First, you will need to open the spreadsheet and select the column to the right of where you want the new columns to be added. Then, right-click on the column letter and select "Insert" from the drop-down menu. This will create a new column to the left of the selected column. Repeat this process for as many new columns as you want to add.

Yes, you can append new columns into Excel without disrupting the existing data. As mentioned in the previous answer, when you insert a new column, it will be added to the left of the selected column. This means that the existing data in the selected column and all columns to the right will be shifted over to make room for the new column. However, the data itself will not be altered or deleted.

Yes, there is a limit to the number of columns you can append into an Excel spreadsheet. The exact limit may vary depending on the version of Excel you are using, but generally, it is around 16,000 columns. If you need to add more columns, you will need to split your data into multiple spreadsheets or use a different software that can handle a larger number of columns.

Yes, you can append data from another Excel spreadsheet into your current one. This can be done by copying and pasting the data, or by importing the data from another spreadsheet using the "Import Data" function in Excel. However, keep in mind that the data may need to be formatted in a specific way in order for it to be properly appended into your current spreadsheet.

In most cases, appending new columns into an Excel spreadsheet should not affect any formulas or functions that are already in the spreadsheet. However, if the inserted columns are in close proximity to existing formulas or functions, they may need to be adjusted to account for the new columns. It is always a good idea to double-check your formulas and functions after adding new columns to ensure they are still accurate.

Share:

- Replies
- 2

- Views
- 676

- Replies
- 1

- Views
- 2K

- Replies
- 2

- Views
- 2K

- Replies
- 5

- Views
- 991

- Replies
- 2

- Views
- 2K

- Replies
- 17

- Views
- 3K

- Replies
- 7

- Views
- 2K

- Replies
- 18

- Views
- 5K

- Replies
- 4

- Views
- 446

- Replies
- 1

- Views
- 736