2017-07-11 42 views
0

我正在尋找一種將週中的幾天分類爲週末或週日的方法。目前,我有我的Excel表格列看起來像這樣:將Excel中的Days分類?

Days 
    Monday 
    Tuesday 
    Sunday 
    Friday 

我的目標是到明年創建一個列上表如下:

Days Type 
    Monday Weekday 
    Tuesday Weekday 
    Sunday Weekend 
    Friday Weekday 

有沒有什麼辦法能做這個過程可能是一個公式或什麼?我無法手動完成,因爲有數百行。我無法使用附加組件,因爲它們被我的工作封鎖,而且它只是下載附加組件的漫長過程。

+0

好像你可以只檢查的第一個字母是S – Slai

回答

2

如果日在A1向下,把這個公式B1和向下複製

=IF(MATCH(A1, {"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"}, 0) < 6, "Weekday", "Weekend")

+0

此表現的很出色。謝謝。 – Vindication09

2

= IF(OR(A1 = 「星期一」; A1 = 「星期二」; A1 = 「星期三」 ; A1 = 「星期四」; A1 = 「星期五」); 「平日」, 「週末」)

2

隨着A1數據,在B1輸入:

=LOOKUP(A1,{"Friday","Monday","Saturday","Sunday'","Thursday","Tuesday","Wednesday"},{"weekday","weekday","weekend","weekend","weekday","weekday","weekday"}) 

enter image description here

注:

公式中的天爲按字母順序。

2

三個以上,

=choose(iferror(sign(match(a1, {"Saturday","Sunday"}, 0))+1, 1), "Weekday", "Weekend") 

=choose(isnumber(match(a1, {"Saturday","Sunday"}, 0))+1, "Weekday", "Weekend") 

=choose(or(a1={"Saturday","Sunday"})+1, "Weekday", "Weekend") 
+0

就像這些,只檢查兩個重要的日子,所有其他的都可以...非常簡約:) –

0

我個人更喜歡Jeeped的方法。但這裏有另外兩個:

=IF(OR(A2={"Saturday","Sunday"}),"Weekend","Weekday")

如果你真的很討厭打字:

="Week"&IF(OR(A2={"Saturday","Sunday"}),"end","day")