如何在excel中獲得所需的輸出? (How to get the required output in excel?)


問題描述

如何在excel中獲得所需的輸出? (How to get the required output in excel?)

Please tell me how to do the below.

Say I have a single column A. If the data in the 1st 3 rows 1st field is 

XPWCS432, XPWCS440, XPWCS394, XPWCS395, XPWCS396, XPWCS397, XPWCS398, XPWCS399, XPWCS476, XPWCS390, XPWCS391
XPWCS432, XPWCS470
XPWCS432, XPWCS434, XPWCS312, XPWCS313, XPWCS314, XPWCS315, XPWCS316, XPWCS317, XPWCS318, XPWCS319, XPWCS320, XPWCS321, XPWCS322, XPWCS323, XPWCS324, XPWCS325, XPWCS326, XPWCS327, XPWCS328, XPWCS329, XPWCS330, XPWCS331, XPWCS372, XPWCS332

The output data should be like below 

1)with out leading and traiiling comma 2)No spaces between values,no duplicates and values should be comma seperated

The below conditions should be achieved.

1) Remove the ,(comma) if it appears at the starting of string. 2) Remove any blank spaces in the string. 3) sort the string words in ascending and remove the duplicate words in the string.

The data(words)  in the field are changing from row to row i.e column1 row1 field1 may contain 3 words row2 field1 may contain 10 words  row3 field1 may contain  20 words like this there may be say some 100 rows. Thanks, Srihai

‑‑‑‑‑

參考解法

方法 1:

I Should propose record the following macro of excel commands:

  • Text to columns, with "space" and "comma" as delimiter to remove them.
  • Traspose the data row to a data column.
  • Remove Duplicates and sort of data.
  • Traspose the data column to a data row.

(by user840963Alen)

參考文件

  1. How to get the required output in excel? (CC BY‑SA 3.0/4.0)

#excel-2003 #excel-2007 #excel #vba #excel-formula






相關問題

使用 VBA 根據 B 列的值重置 A 列中的值 (Reset values in column A based on the value of column B using VBA)

Пераўтварэнне формулы ячэйкі ў тэкст з дапамогай excel vba (Converting a cell's formula to text using excel vba)

刪除行並維護輸入範圍 (Delete Rows & Maintain Input Range)

從 VBA 自動排序中排除文本值 (Exclude Text Value From VBA Autosort)

Tại sao tôi không thể tạo biểu đồ này trong excel (sử dụng powershell) (Why can't I create this chart in excel (using powershell))

如何使用 VBA 從 Excel 中的公式中獲取單元格值? (How do I get the cell value from a formula in Excel using VBA?)

讓 Excel 2003 在 Word 文檔中進行查找並返回出現次數 (Have Excel 2003 do a Find in a Word document and return the number of occurences)

驗證下拉條件 (Validation Drop down on a condition)

在位於兩個不同工作表的兩個範圍內添加單元格 (Adding cells in two ranges which are located at two different sheets)

如何在excel中獲得所需的輸出? (How to get the required output in excel?)

從復雜查詢中獲取數據到 Excel (Getting data from a complex query to excel)

使用文本格式的用戶定義輸入從 excel 中檢索數據 (Retrieving data from excel with user defined input that is in text format)







留言討論