[英]I have a set of dates in 6 columns in an excel sheet. How do I find the common dates in all these 6 columns?
[英]I have two tables in the same Sheet. How do I align rows which have the same set of data using Excel or VBA?
可能不是最好的方法,但一種相對簡單的方法可能是讓您手動執行的操作自動化。 循環遍歷行,檢查您想要的列是否相同,使用Range.Insert
方法執行插入而不是手動執行。
如果這是 SQL 中的一對表,則您要查找的內容相當於感興趣的三列上的兩個表的FULL OUTER JOIN
。 在這個超級用戶問題中有一些關於在 Excel 中執行此類操作的信息。
我將示例數據放入 SQL 數據庫中,並能夠使用以下查詢重現所需的輸出:
SELECT t1.*
FROM Table1 t1
FULL OUTER JOIN Table2 t2 ON t1.Number = t2.Number AND t1.[Name] = t2.[Name] AND t1.[Order] = t2.[Order]
ORDER BY CASE WHEN t1.Number IS NULL THEN t2.Number ELSE t1.Number END
SELECT t2.*
FROM Table1 t1
FULL OUTER JOIN Table2 t2 ON t1.Number = t2.Number AND t1.[Name] = t2.[Name] AND t1.[Order] = t2.[Order]
ORDER BY CASE WHEN t1.Number IS NULL THEN t2.Number ELSE t1.Number END
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.