Combine 2 formula into/be i formula - rick's formula

muhammad susanto

Well-known Member
Joined
Jan 8, 2013
Messages
2,077
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
hi all....

i want to combine 2 formula into 1 formula (Rick's formula)

data (col.a)result after use formula Aresult after use formula Bsingle formula (combine) ??
08/12/2005 (as date)2005-12-082005
01/07/1992 (as date)1992-07-011992
1986-7-45 (as text)1986-7-451986
2001-10-380 (as text)2001-10-3802001

<tbody>
</tbody>

formula A :
Code:
[COLOR=#333333]=IF(COUNTIF(A1,"*-*"),A1,TEXT(A1,"yyyy-mm-dd"))[/COLOR]

http://www.mrexcel.com/forum/excel-...-number-different-format-date-vs-general.html

then
formula B
Code:
=LEFT(B1,4)+(--LEFT(B1,4)=2010)*(--SUBSTITUTE(MID(B1,5,3),"-","")>6)

http://www.mrexcel.com/forum/excel-questions/880218-extract-some-number-year-2.html

how do make it. It's possible?

thank in advance..

m.susanto
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Try

=LEFT(IF(COUNTIF(A1,"*-*"),A1,TEXT(A1,"yyyy-mm-dd")),4)+(--LEFT(IF(COUNTIF(A1,"*-*"),A1,TEXT(A1,"yyyy-mm-dd")),4)=2010)*(--SUBSTITUTE(MID(IF(COUNTIF(A1,"*-*"),A1,TEXT(A1,"yyyy-mm-dd")),5,3),"-","")>6)
 
Upvote 0
hi all....

i want to combine 2 formula into 1 formula (Rick's formula)

data (col.a)result after use formula Aresult after use formula Bsingle formula (combine) ??
08/12/2005 (as date)2005-12-082005
01/07/1992 (as date)1992-07-011992
1986-7-45 (as text)1986-7-451986
2001-10-380 (as text)2001-10-3802001

<tbody>
</tbody>
It is not clear to me what you want the combined formula to output... can you fill in the "single formula (combine)" column so we can see what you want?
 
Upvote 0
hi guys..it works for me

Code:
=IF(ISNUMBER(A2);IF(AND(A2>=DATE(2010;7;1);A2<=DATE(2010;12;31));2011;YEAR(A2));IF(AND(--LEFT(A2;4)=2010;--MID(A2;6;2)>=7);2011;LEFT(A2;4)))

any more shorter? or other idea?
 
Upvote 0
Using Rick's solution, try

=IF(AND(ISNUMBER(A2),A2>=DATE(2010,7,1),A2<=DATE(2010,12,31)),2011,0+LEFT(TEXT(A2,"yyyy"),4))
 
Upvote 0

Forum statistics

Threads
1,215,832
Messages
6,127,149
Members
449,365
Latest member
AlienSx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top