![]() |
|
#1
|
||||
|
||||
![]() Hi all, below is a formula concatenating values from 2 columns. It returns a string like 2019-1-1. I would like the result to appear as 2019-01-001. I tried inserting TEXT before the month and number but I always come up with "too many arguments" message. Kindly check my formula. Thank you. Code:
=YEAR([@Date])&"-"&MONTH([@Date])&"-"&[@ObR] |
#2
|
|||
|
|||
![]()
With date in A1
=DATE(YEAR(A1),MONTH(A1),DAY(A1)) Format the cell with the formula: yyyy-mm-"00"d |
#3
|
||||
|
||||
![]() Quote:
A1: January 18, 2019 (named range "Date") B1: 1 (named range "ObR") C1 where the formula is: 2019-01-001 |
#4
|
|||
|
|||
![]()
C1 where the formula is: 2019-01-001 ...
Not understood. |
#5
|
|||
|
|||
![]()
Is it like this
|
#6
|
||||
|
||||
![]()
As dates can cause problems, it's always best to post a small sample sheet
It saves the person helping time
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#7
|
|||
|
|||
![]() Code:
=TEXT(Date,"yyyy-mm-") & RIGHT("000" & Obr,3) |
#8
|
||||
|
||||
![]()
Noted, Pecoflyer about the sample data. Thank you Xor and Arvi. I got confused by the "DAY" in both of your formula and when I removed it just leaving the "ObR" as the reference, the result is still the desired format, 2019-01-001. I need to explore further the function of the two negatives before the formula. I tried deleting the negatives but the formula returned 2019-1-1.
|
#9
|
|||
|
|||
![]()
--(Logical Expression) converts boolean value of expression (True or False) to numeric (1 or 0)
|
#10
|
|||
|
|||
![]()
Probably Xor assumed, that @Obr is day number! Set the value for @Obr e.g. to 99, and look what happens!
|
#11
|
||||
|
||||
![]() Quote:
I love this forum. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need Help Deleting Numbers in Hour Format and Numbers in Sequence | rsrasc | Word VBA | 1 | 10-12-2016 02:49 PM |
![]() |
ddhawks | Excel | 2 | 07-12-2016 11:48 PM |
![]() |
shilabrow | Excel | 5 | 06-26-2014 12:17 AM |
Formula to count entries as per month, year and submission wise from different sheets | pinkacidpunk | Excel | 1 | 05-28-2013 08:26 AM |
Formula to subtract one month from due date field in reminder field | ghumdinger | Outlook | 1 | 10-01-2011 12:09 AM |