A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

populate month-yyyy when compare 2 cells



 
 
Thread Tools Display Modes
  #1  
Old May 12th, 2010, 10:01 AM posted to microsoft.public.excel.worksheet.functions
AskExcel
external usenet poster
 
Posts: 14
Default populate month-yyyy when compare 2 cells

Dear Forum,
I have a scenario where I need to compare 2 date cells. When cell1 empty
then take cell2 and format the date month-yyyy in cell3. When cell1 not empty
then take cell1 date and format the date month-yyyy in cell3.

i need advise how can i do that and create macro to automate the change.
example
c d e
20100220 feb-2010

c d e
20100521 20100220 may-2010


  #2  
Old May 12th, 2010, 10:17 AM posted to microsoft.public.excel.worksheet.functions
Roger Govier[_8_]
external usenet poster
 
Posts: 338
Default populate month-yyyy when compare 2 cells

Hi

Try
=IF(COUNT(C11),
IF(C1,TEXT(DATE(LEFT(C1,4),MID(C1,5,2),1),"mmm-yyyy"),
TEXT(DATE(LEFT(D1,4),MID(D1,5,2),1),"mmm-yyyy")),"")

All the above should be on one line
--
Regards
Roger Govier

AskExcel wrote:
Dear Forum,
I have a scenario where I need to compare 2 date cells. When cell1 empty
then take cell2 and format the date month-yyyy in cell3. When cell1 not empty
then take cell1 date and format the date month-yyyy in cell3.

i need advise how can i do that and create macro to automate the change.
example
c d e
20100220 feb-2010

c d e
20100521 20100220 may-2010


  #3  
Old May 12th, 2010, 11:13 AM posted to microsoft.public.excel.worksheet.functions
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default populate month-yyyy when compare 2 cells

If the dates are in excel date format try the below with dates in c2 :d 2
=TEXT(INDEX(C22,MATCH(TRUE,INDEX(C22"",),)), "mmmm-yyyy")

If the dates are in text format try the below with dates in c5 : d5

=TEXT("2010/" & MID(INDEX(C55,MATCH(TRUE,INDEX(C55"",),)),5, 2) &
"/20","mmmm-") & LEFT(INDEX(C55,MATCH(TRUE,INDEX(C55"",),)),4 )

--
Jacob (MVP - Excel)


"AskExcel" wrote:

Dear Forum,
I have a scenario where I need to compare 2 date cells. When cell1 empty
then take cell2 and format the date month-yyyy in cell3. When cell1 not empty
then take cell1 date and format the date month-yyyy in cell3.

i need advise how can i do that and create macro to automate the change.
example
c d e
20100220 feb-2010

c d e
20100521 20100220 may-2010


  #4  
Old May 13th, 2010, 02:14 AM posted to microsoft.public.excel.worksheet.functions
AskExcel
external usenet poster
 
Posts: 14
Default populate month-yyyy when compare 2 cells

Dear Expert,
I would like to built 1 macro so that I can execute the macro to mass change
it but I do not know how to put this code in visual basic
in between sub() and endsub()
Please help.
Thanks alot

=IF(COUNT(C11),
IF(C1,TEXT(DATE(LEFT(C1,4),MID(C1,5,2),1),"mmm-yyyy"),
TEXT(DATE(LEFT(D1,4),MID(D1,5,2),1),"mmm-yyyy")),"")
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:20 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.