#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Date Functions

Hi,

I need unique number to identify each month in the calendar system.

The formula
'=VALUE(RIGHT(YEAR(DATEVALUE("1-04-2016")),2)&"0"&MONTH(DATEVALUE("1-04-2016")))'returns
the number I wanted for the current month.

This there any better way of doing this?

TIA
Ahmed

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Date Functions

Hi Ahmed,

Am Thu, 21 Apr 2016 12:40:45 +0530 schrieb ahmed:

'=VALUE(RIGHT(YEAR(DATEVALUE("1-04-2016")),2)&"0"&MONTH(DATEVALUE("1-04-2016")))'returns
the number I wanted for the current month.

This there any better way of doing this?


try:

=--(TEXT(DATEVALUE("1-04-2016"),"yy")&TEXT(DATEVALUE("1-04-2016"),"MM"))


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Date Functions

Hi Ahmed,

Am Thu, 21 Apr 2016 09:31:26 +0200 schrieb Claus Busch:

=--(TEXT(DATEVALUE("1-04-2016"),"yy")&TEXT(DATEVALUE("1-04-2016"),"MM"))


for me also works:
=--(TEXT("1-04-2016","yy")&TEXT("1-04-2016","MM"))


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,872
Default Date Functions

Hi again,

Am Thu, 21 Apr 2016 09:39:10 +0200 schrieb Claus Busch:

=--(TEXT(DATEVALUE("1-04-2016"),"yy")&TEXT(DATEVALUE("1-04-2016"),"MM"))


for me also works:
=--(TEXT("1-04-2016","yy")&TEXT("1-04-2016","MM"))


you also can enter a correct date and format it custom
YYMM


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Date Functions

On 21/04/2016 01:28 PM, Claus Busch wrote:
Hi again,

Am Thu, 21 Apr 2016 09:39:10 +0200 schrieb Claus Busch:

=--(TEXT(DATEVALUE("1-04-2016"),"yy")&TEXT(DATEVALUE("1-04-2016"),"MM"))


for me also works:
=--(TEXT("1-04-2016","yy")&TEXT("1-04-2016","MM"))


you also can enter a correct date and format it custom
YYMM


Regards
Claus B.


Both the formulas work fine.
Thank you, Claus.

Kind Regards,
Ahmed.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Functions Keith Excel Discussion (Misc queries) 2 April 24th 06 06:43 PM
Date and Sum functions (HELP) aaronr Excel Discussion (Misc queries) 2 April 19th 06 07:30 PM
Date functions Bonniem Excel Discussion (Misc queries) 2 October 11th 05 03:00 AM
Date functions excelpomoc Excel Worksheet Functions 2 September 14th 05 04:58 PM
DATE Functions??? malay_ko Excel Programming 2 May 5th 04 09:51 AM


All times are GMT +1. The time now is 11:41 AM.

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

About Us

"It's about Microsoft Excel"