How to vertically list all days of the month in Google Sheets - date

With Populate a Full Month’s Dates Based on a Drop-down in Google Sheets how to I was able to list all days of a month next to each other.
=TRANSPOSE(ARRAY_CONSTRAIN(ArrayFormula(date($A$1;MONTH(A2&1);1)+transpose(COLUMN($C$1:$BK$1)-3));DAY(EOMONTH(date($A$1;MONTH(A2&1);1);0));1))
What do I need to change in the current formula to list them below each other?

I am going to take a wild guess and say Erase the word "transpose()"
=(ARRAY_CONSTRAIN(ArrayFormula(date($A$1;MONTH(A2&1);1)+transpose(COLUMN($C$1:$BK$1)-3));DAY(EOMONTH(date($A$1;MONTH(A2&1);1);0));1)

Remove the TRANSPOSE function invocation:
=ARRAY_CONSTRAIN(ArrayFormula(date($A$1;MONTH(A2&1);1)+transpose(COLUMN($C$1:$BK$1)-3));DAY(EOMONTH(date($A$1;MONTH(A2&1);1);0));1)

EDIT
(Following your commentHow to vertically list all days of the month in Google Sheets)
I gave it a try but I got a Parse error.
ALWAYS CHECK YOUR LOCALE (when using copy/paste)
In your case you ONLY have to change , to ;.
So the formulas will be
For Horizontal
=TRANSPOSE(SEQUENCE(DAY(EOMONTH(A1&A2;0));1;A1&A2;1))
For Vertical
=SEQUENCE(DAY(EOMONTH(A1&A2;0));1;A1&A2;1)
Use twice and format accordingly.
Original answer.
Instead of that long formula try this one.
For Horizontal
=TRANSPOSE(SEQUENCE(DAY(EOMONTH(A1&A2,0)),1,A1&A2,1))
For Vertical
=SEQUENCE(DAY(EOMONTH(A1&A2,0)),1,A1&A2,1)
Use twice and format accordingly.

That`s great but the dates I am getting are not in a chronological order since their "code" is something like 44324 and they are order by it.

Related

Displaying tick labels with google flutter charts

We are trying to display a year's (12 months) worth of data on a chart. It is close to working but the labeling of the month is weird. It seems like random months are labelled and some are not.
We figured out how to make it work but don't understand why.
We are using a StaticDateTimeTickProviderSpec. When we set the format arg only (ex: "MMM"), it doesn't label some months. When we set the transitionFormat arg it works.
What is the difference between "format" and "transitionFormat"? The online docs are somewhat minimal.
Thanks,
Mike

MINIFS/MAXIFS formula breaks in LibreOffice Calc but works in Excel and Sheets?

I'm trying to convert a bunch of spreadsheets from Excel to LibreOffice Calc and I have one formula that works perfectly in Excel and I even tried Google Sheets but it gives a #NAME? error only in LibreOffice Calc. I think it's something to do with the " " or maybe missing $ but I've tried a bunch of troubleshooting with no success. I'm new to Calc so maybe I'm missing a formatting rule...
The formula is supposed to create a min/max date range for an alphanumeric code that could be anywhere inside a cell in the range. It's used to show when an action started and when it stopped. It works perfectly in Excel and Google Sheets but not with Calc.
=TEXT(MINIFS($master data.H:H,$master data.AE:AE,"*"&B3&"*"),"yyyy")&" - "&TEXT(MAXIFS($master data.H:H,$master data.AE:AE,"*"&B3&"*"),"yyyy")
The formula should return something like 2003 - 2004 but instead it returns 1899 - 1899 for everything.
This version of the formula works perfect in Google Sheets:
=TEXT(MINIFS('master data'!H:H,'master data'!AE:AE, "*"&B3&"*"),"yyyy")&" - "&TEXT(MAXIFS('master data'!H:H,'master data'!AE:AE, "*"&B3&"*"),"yyyy")
The problem is your sheet name is 'master data', which has a space in between. Different program quotes differently.
For Calc, you should use single quote after the $, like this:
$'master data'
So your formula should be something like this:
=TEXT(MINIFS($'master data'.H:H,$'master data'.AE:AE,"*"&B3&"*"),"yyyy")&" - "&TEXT(MAXIFS($'master data'.H:H,$'master data'.AE:AE,"*"&B3&"*"),"yyyy")
In the future, if you run into issues with formula, you should break down the long formula, and try to solve each issue as you encounter it. So for this case, I simply tried to see how Calc would reference another sheet by entering = then click on a cell (say A1) in "master data". The result was:
=$'master data'.A1

Extract word between two words in Tableau

My data in a single column looks like this
Environment: PROD_A
JobName: MY JOB NAME 1
MemName: Some_Script_names
My aim is to create a calculated field where it fetches JobName.
In above sample. The output should be MY_JOB_NAME_1
Here's my code in Tableau -
MID([Description],FIND([Description],"JobName: ")+9,
FIND([Description],"MemName: ")-FIND([Description],"JobName: ")-9)
The above logic is same as excel function below. It basically finds first word and last word and then picks the one in between.
=MID(A1,SEARCH("JobName: ",A1)+9,SEARCH("MemName",A1)-SEARCH("JobName: ",A1)-9)
Issue -
Tableau is showing blank data. Not sure where my logic is wrong. Any help is appreciated.
You may be able to use REGEX funtions (depending on your data source). Try this: REGEXP_EXTRACT([Data],'JobName: (.*)')
I see that you commented that the text is in one cell and not one column as you wrote in question.
This finds the JobName and uses that position plus the lenght of it as the startposition, then finds MemName as the endposition (and calculates the number of characters between them)
=MID(A1,FIND("JobName: ",A1)+LEN("JobName: "),FIND("MemName",A1,FIND("JobName: ",A1)+LEN("JobName: ")+1)-(FIND("JobName: ",A1)+Len("JobName: ")))
The following tableau calc works, this assumes that there is no space after MY_JOB_NAME_1 and "MemName:"
MID([Text],
FIND([Text],'JobName: ')+10,
FIND(
MID([Text],
FIND([Text],'JobName: ')+10)," ")-9)

Is there a way to detect when a field mark with 'can grow' has truncated the field data?

I do not normally work with crystal, but I have spent nearly 2 days looking for a way to do this.
The problem is that I have a number of lines of text that need to show on a report, but need to cut off after 8 lines and show a 'more' prompt to inform the user that they need to go look at the rest of the details online. This was originally handled by storing the data as individual lines already wrap to size and counting the lines with a formula and conditionally showing a separate 'more' field. They have since added the ability to use html to the text, but this made the current way of doing things wrap incorrectly and show the html mark up.
I wrote a database function to combine the text into a single field and use the HTML text interpretation to display it correctly on 7 other reports that do not limit the text length, and the max line count works great for limiting the text size, I just can't figure out how to show the 'more' prompt when needed.
Any suggestions would be greatly appreciated.
GrumpyGeek,
If your database function now combines the text into a single field does this mean the original way, with the separated lines, is still stored? If so, why not add another calculated field called 'line-count' that tallies the old line-based data?
So you'd still have your new combined HTML field and this new field that you could use to show the 'more' button when 'line-count > x'?
Alternatively, another option might work, but would be a bit touchy. That is to make the formula that shows the more button trigger when the field length exceeds x. The catch is that html mark-up isn't displayed, and heavy use of it would skew the amount of text required before you should show the 'more' button. Put another way, a field with very heavy use of mark-up ( and tags) might force the 'more' button earlier than it should. Unless you could somehow make either your 'line-count' calculated field exclude the mark-up OR make the length calculation do the same.
This would be possible if MSSQL or Crystal Reports could run regex to strip the mark-up.
If NONE of the above works, the only other thing I can suggest is to look into UDFs. Crystal allows you to load an external library that you write. These will read functions you write and show them in the function list inside Crystal. If you do this, then you could easily write a routine that strips the HTML and calculates when the more button should be shown.
Good luck with it.
Ideally, there would be a property of the DB field that would return its displayed line count. Unfortunately, there is no such property.
You could try counting the # of line ending characters (e.g. carriage return, line feed). If they are > 7 then show the hyperlink. In a HTML situation, you have to count ending elements (e.g. ). You could make use of a RegEx UFL to make it easier to identify the elements.
Probably the easiest route is to the DB to calculate the # of lines and return that as another field. Use this field to hide/show the hyperlink.

Excel/VBA - Copy and paste data into a worksheet in a specific row based on date

I have what I think is a pretty simple question.
I have a report that is updated daily. A specific range (B5:AC5) from one worksheet needs to be copied to a different worksheet on a daily basis. This doesn't need to be done automatically, I'd just like to add the code for it into a formatting macro I've created.
I have two issues with this:
I want the data to be pasted in the row that corresponds with that specific day. Column A in worksheet "Daily" has the list of working days for that month. So all I need is for the macro to find today's date in Column A in "Daily", and paste b5:AC5 from "Matrix" in b?:ac? in that row on "Daily".
I also need it to be a paste special, with only the values being pasted.
I'm very new to VB, but can usually follow code logic pretty well. Let me know if you need any more information from me. Thank you so much!
Assuming that your range will always be in B5:AC5, here is what I came up with:
Sub FindToday()
Dim FoundDate As Range
Set FoundDate = Worksheets("Daily").Columns("A").Find(DateValue(Now), LookIn:=xlValues, lookat:=xlWhole)
If Not FoundDate Is Nothing Then ' if we don't find the date, simply skip.
Worksheets("Matrix").Range("B5:AC5").Copy
FoundDate.Offset(0, 1).PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, False ' You can see that the first argument in PasteSpecial is set to only paste values.
End If
End Sub
I tested this as best I could given your information. I put a set of ascending numbers in the B5:AC5 range, with formulas, put a set of ascending dates for one month in the Daily sheet, and it seems to do what you're looking for.
Hope this helps.