I need to provide an output with name of days worked, from the dates given in Timesheet Notes column. The column is a software generated column, and hence the format cannot be altered. How do I get this output with some excel Formula without using Macros.
Thanks in advance :)
This seems to do the trick:
=IF(ISNUMBER(A2),TEXT(A2,"dddd"),TEXTJOIN(" - ",TRUE,TEXT(FILTERXML("<t><s>"&SUBSTITUTE(A2,"-",MID(A2,FIND("/",A2),LEN(A2))&"</s><s>")&"</s></t>","//s"),"dddd")))
Edit: made formula slightly shorter & added explanation.
Extract the month and year from the end of the text string:
MID(A2,FIND("/",A2),LEN(A2))
This will return something like /07/21
Replace the - in the original string with the month, year and a couple of XML tags:
SUBSTITUTE(A2,"-", <previous formula> & "</s><s>")
This will return something like 03/07/21</s><s>04/07/21.
Add some opening/closing tags to your XML and create a table of individual dates:
FILTERXML("<t><s>" & <previous formula> & "</s></t>","//s")
This will return each date (as a number) on a separate row - 44380 / 44381
Convert each number into the day name:
TEXT(<previous formula>,"dddd")
This will return on separate rows - Saturday / Sunday
Join it all together with a delimiter:
TEXTJOIN(" - ",TRUE,<previous formula>)
Add a check for the cell containing a single date:
IF(ISNUMBER(A2),TEXT(A2,"dddd"),<previous formula>)
Here is the formula for one or two days, with more days it'll be even more complex.
=TEXT(DATE(VALUE(RIGHT(A2,4)),VALUE(LEFT(RIGHT(A2,7),2)),VALUE(LEFT(A2,2))),"dddd")&IF(LEN(A2)>10," - "&TEXT(DATE(VALUE(RIGHT(A2,4)),VALUE(LEFT(RIGHT(A2,7),2)),VALUE(MID(A2,4,2))),"dddd"),"")
Here is a formula for max 3 days with LET function. It's available only in newest versions of Excel 365. You can write more efficient calculations with it, however still it'll be very complicated if you really need to generalize it.
=LET(year,VALUE(RIGHT(A4,4)),month,VALUE(LEFT(RIGHT(A4,7),2)),day_1,VALUE(LEFT(A4,2)),day_2,IF(LEN(A4)>10,VALUE(MID(A4,4,2)),""),day_3,IF(LEN(A4)>13,VALUE(MID(A4,6,2)),""),TEXT(DATE(year,month,day_1),"dddd")&IF(day_2<>""," - "&TEXT(DATE(year,month,day_2),"dddd"),"")&IF(day_3<>""," - "&TEXT(DATE(year,month,day_3),"dddd"),""))
With a dataset such as this:
Date, Value
04.03.2020, 13.35
04.03.2020, 13.8
04.03.2020, 21.21
You can split the data using Data > Text to columns and specifying the value separator.
The problem is that Excel recognizes 13.8 as august 13, so the output is:
Date Value
04.03.2020 13.35
04.03.2020 13.aug
04.03.2020 21.21
How can I make sure that Excel never interprets decimal numbers such as 13.8 as dates?
I'm working in a region that uses , as decimal separator, but I often have to work with data that is set up with . as the decimal separator. One work-around is of course to replace , with ; and . with , before opening a .csv file. And if the only other solution is to set it up with VBA, I'm perfectly able to do so myself. But I often find myself trying to help colleagues on their computers without my own VBA configurations ready to go. So if there's any other way to do this using standard Excel system settings, that would be great!
This little problem has bugged me for years and I'm eager to get rid of it once and for all.
Edit:
I'm running Excel version 1908 on Windows 7, Office 365.
This problem often occurs when I'd like to inspect csv files that are recognized as Excel files on my system. There have been suggestions to format the cells as General before splitting the data. That does not seem to work on my end.
Another solution is to get what you want with formulas:
Formula for Dates:
=TEXT(LEFT(A2,FIND(",",A2,1)-1),"General")
Formula for Values:
=TEXT(MID(A2,(FIND(",",A2,1)+2),(LEN(A2)-(FIND(",",A2,1)+1))),"General")
Results:
During Text to Column process at Step 3 you have the option to to select Data Column Format you could also select the Value column and play around with Text or General formating.
I am trying to get a Summary of multiple Cells into one Cell (for later use in GCalender). Trying to Concatenate a Date results into #ERROR! and similar questions and results found online dont work at all.
Example Sheet
Expected result should be:
="anything "&C2& " - " &TEXT(E2,"dd/mm/yyyy")
=anything thishappens - 10/03/2020
But Quoting the date alone will result in just a number (43900), and the TEXT and DATE formate will not work as found online or examples by Google.
It looks like you might be in Europe or somewhere where they use ; instead of , as the parameter separators in formulas. Try this:
="anything "&C2& " - " &TEXT(E2;"dd/mm/yyyy")
I am not so familiar with how programming works (only a few attempts with Java) and since i am currently studying at a gymnasium (with focus on economics) i would like some help for how i can create an excel-template for my needs. However i can not figur out how to do so. I know how some of the basic macros functions in excel, but i would like do the following for my template:
1) Input some data (i think manually would be to prefer since i am often working with pictures). The data is some diffrent numbers form an annually report.
2) The data should then be used to calculate some different financial key figures (i know how to do this as well).
I don't know how to do the following
3) When the key figures have been calculated and the change from year to year also have been calculated, i would like to use some basic sentences to comment on the numbers: E.g. "The key figure xxxx has gone up by xx% over xx% years. This development is caused by the xx... [and so on]"
3.1) I would like the template to be able to comment on change over the key figures over the entire period, the biggest changes over the period (both ups and downs), the lowest and highest point on the period.
4) Export the text with the comments to a word document from the excel-spreadsheet.
I don't know which commands/functions i would need to use and how to use them if it is even possible to do in excel (but i'm willing to learn this by myself).
You don't necessarily need programming. Simple formula within cells could do this.
="The key figure " & A1 & " has gone up by " & B1 & "% over..."
You can use it with some IF statements that determines if the figure has gone up or down. IF(A1<0, "down","up"), this can give your commentary a bit of flexibility.
You probably don't need to export to word either, you can link the excel table to word. So every time the spreadsheet updates, then the content of word updates.
I have two SSRS Parameters, Date/Time type: BeginDate and EndDate. I want them to default to EndDate=Today() and BeginDate=Today()-six months. Using Report Parameters, Default Values, I add a value and create the function =Today() but I get the red squiggly line under the parens.
If I select the function from the Category list and double click it into the "Set Expression for:Value" box, I get the function with a single open-paren and the red squiggly which remains if I close off with a close-paren.
I get the same error if (following the example in the "Example" section, for crist's sake) of =DateAdd("m", -6, Today()) I get the same error instead of a date six months prior.
A little help please...?
Thanks
The problem is that you are using SQL command syntax but Reporting Services uses VBA.
Even though the examples show Today() with the brackets after it, as if it was a method, that actually displays as a syntax error for me in the expression editor. Today's date is simply accessed like a property:
=Today
DateAdd exists but uses DateInterval properties, not the SQL "m" so six months ago is:
=DateAdd(DateInterval.Month, -6, Today)