excel - Converting different date formats -


this continuation of other question how convert quarter years other format

ok need convert more stuff :)

i need convert yyyy-mm yyww ex. 2022-10 2241 // week 41 because halfway through 0ctober.

i need w.yyww become yyww , v.yyww yyww week in swedish (vecka)

and last not least need have convertion previous question yyyy-quarter(1234) yyww code used that

=1*if(isnumber(-a1),a1,mid(a1,3,2) & choose(right(a1,1),"08",20,33,46))

best case scenario if 1 formula convert of these yyww because referencing cell timeline work.¨

week of month take. took week of day 15 in every month. can take them 4 weeks apart or whatever method u might use. exact week or date not needed take close middle of month.

1 january 02

2 february 07

3 march 11

4 april 15

5 may 19

6 june 24

7 july 28

8 aug 33

9 sep 37

10 oct 41

11 nov 45

12 dec 49

ex. 2019-05 becomes 1919

2023-11 becomes 2345

2016-08 becomes 1633

alright w.yymm yymm , v.yymm yymm same formula of right(d8,4) #1 work.

yymm #2 doesn't need change

yyyy-qq requires =mid(d8,3,2) & choose(right(d8,1),"08",20,33,46) #3

and yyyy.mm requires =mid(d8,3,2)&choose(right(d8,2),"02","07",11,15,19,24,28,33,37,41,45,49) #4

so need combine formulas , choose between them.

easiest choose length... minimizes nesting.

so =if(len(d8)=4,"#2",if(len(d8)=6,"#1",if(mid(d8,5,1)="-","#3","#4")))

or combined, 1* on front:

=1*if(len(d8)=4,d8,if(len(d8)=6,right(d8,4),if(mid(d8,5,1)="-",mid(d8,3,2) & choose(right(d8,1),"08",20,33,46),mid(d8,3,2)&choose(right(d8,2),"02","07",11,15,19,24,28,33,37,41,45,49)))) 

next time.... think let yourself. have provided technique of getting there, need use evaluate formula , google see did , how did it


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -