Excel - Insert "day" on a cell and format it to date with current month and year - date

I am working on a home accounting template (and could not find any good one :-/), so I am creating one for each month. Both in my expenses and my incomes, I would like to have a date column where I just have to insert the "day" (e.g.: 22) and it automatically fills the rest with the current month and year (or I could set them in another cell).
For example: 22 + ENTER would return: 22/12/2014
If I do this, I automatically get a default date: 22/01/1900
I do not know if it is possible to change this defaul date depending on the current one or any other value.
I have tried with a different strategy: if the amount column is not empty, fill in with today's date: =IF(A3="";"";TODAY())
The problem is that I do not always register today's expenses, so I need to change it manually. I was just wondering if this is possible and there is a better way (maybe a macro?).

You need Excel to modify the cell contents after you press ENTER. The only option seems to be a Macro using the Worksheet_Change event.
Please check out this other question. I think that will help.

This can be achieved with simple formatting and use of controls that are available in Excel. VBA will give you drastically more flexibility, however the request above can be accomplished without learning VBA.
I have included a sample file here.
Steps to recreate:
Create a range of months. I created a range including the current month through 12/2014
Insert a combo box from the developer tab. Right click and select Format Control. On the Control tab, input the range you just created and then select a "linked cell". This will insert an integer to indicate which item you picked in the list, starting at 1.
Use the attached formula to add the DAY that you enter in the first column and VLOOKUP the month and year from the value chosen in the combo box.
Enhancements: I used conditional formatting to change the text color of the days you enter to WHITE. This way you won't see them. I also included some checking in the VLOOKUP formula: the day you enter must be a number and must be non-blank for a date to populate.

Related

Counting days between 2 dates and swapping one of the dates for another if cell if not empty - google sheets

As the title suggests I'm wondering if there is a way to count days from 1 Column from the current day, then when filling in another column it stops counting the difference in days?
I'm using the following formula (found online)
={"Days";ArrayFormula(if(A3:A="",,int(B3:I)-left(A3:A,10)))}
Column A being where my date of entry is, column B is a hidden column with every row set to the
=Today()
I have another column, Column C that I will enter the date manually after date of completion, at which point I would like it to then stop counting the days and show me the number of days between Column A and C (Date 1 and Date 2)
I'm not overly experienced in google sheets but I'm thinking maybe there's a way to
check if column C is empty, if so carry on with todays date, if it's not empty to
calculate Column C - Column A?
Would making an new column for checking if the completion date has been entered work?
ISBLANK(C:C)
If so would it be possible to get one formula to check whether True or False and determine what 2 dates to work with? Lets say Column D is for ISBLANK the following is what I think of
={"Days";ArrayFormula(if(CD:D="False",,int(C3:C)-left(A3:A,10)))}
={"Days";ArrayFormula(if(D3:D="True",,int(B3:B)-left(A3:A,10)))}
When I try this I have no luck and get a "Result was not expanded automatically, please insert more rows (1)" error message
Any help would be appreciated!
Apply the formula :
=if(B2="",today(),B2)-A2
at C2. And drag downwards. That's should do.
Please share if it work/understandable/not.
Sorry it's a bit hard to understand this question, if you could post a current and desired screenshot example that would help I think.
So, I think your best bet here is to review this video if you're wanting sheets to auto-input a time entry when a cell is modified:
https://www.youtube.com/watch?v=548dD3iXetg
And it will show you how to script a cell to enter in a time entry when another cell is edited, and then you could use a variation of formulas to calculate the difference between the days of the original minus the date from the script (such as the once referenced below or by #p.phidot )
So for an example, once you script the time entry to work in the background of the sheet, you have a formula using an IF statement to make it pull between your today date or the new date being entered.
My cell references below are an example as I can't follow the question sheet.
=if(b2="",A2-B2,A2-C2)
This way if b2 is not blank it'll do a2-c2. You could also use ISBLANK if you like.

How to Display a single Date in Google Data Studio?

I want to display a single date dynamically in Google Data Studio. e.g. I want to display last Monday's date whatever it was e.g. 09-11-2020 and it would change to 16-11-2020 as the Monday 16-11-2020 would pass and so on.
I have a connection with BigQuery and I can connect from there to bring the date dynamically from BigQuery as:
SELECT DATE_TRUNC(DATE_ADD(CURRENT_DATE(), INTERVAL 7 day), WEEK(MONDAY)) as coming_monday
&
SELECT DATE_TRUNC(CURRENT_DATE(), WEEK(MONDAY)) as last_monday
So calculating dates isn't a problem as they are being received in Google Data Studio, however, I could not display them appropriately using any of the Google Data Studio tools like Text, etc.
Dates can currently be displayed in Google Data Studio Scorecards; in addition, the Calculated Fields in the question could be recreated by copy-pasting the below into the respective Scorecards, aggregating by MAX or MIN (which would display the same Date in this scenario) and then setting the Type to Date (Default: Date & Time):
1) Coming_Monday
DATETIME_TRUNC(DATETIME_ADD(CURRENT_DATE(), INTERVAL 7 DAY), ISOWEEK)
2) Last_Monday
DATETIME_TRUNC(CURRENT_DATE(), ISOWEEK)
Editable Google Data Studio Report and a GIF to elaborate:
It cannot set single dynamic value with straightforward way as text in GDS now.
But, you can use normal Table tool of GDS with single row, and it will show as single dynamic value that you need. Scorecard can also be used.
Here is how-to of using Table.
Under Data menu, set the date column that you want to display in Dimension, and do not set Metric. Also, choose Rows per page as 1.
Under Style menu, uncheck the Show header checkbox, Rows numbers checkbox and Shows pagination checkbox.
When you view the report, it will show as text.

QLIK 101: I have a data/field with format DD/MM/YYYY. Need to creat bar chart with age range

First time I am using qlik sense. None of the videos that I have watch have help me so far.
I have data/field name 'inscription' with date format dd/mm/yyyy. I need to set age range from 18y to 90y, in range of 10y. For example from 18-28, 28-38...
I have no idea how to do this. I need the formula to do it and also where do I put this formula (its my first time using this tool).
Do I create a new dimension on the left side of the app under custom objects?
Do I put the formula in the right side where I set the dimension(bars) and measures(height)? or under aperance?
I am using qlik sense desktop feb 2019. 13.9.1
Hi I don't see your data so:
1) be sure that your date field is implemented as date by qlikview (you can test it in model viewer) if not please load it as date in load script and you can also calculate current age:
LOAD
(...)
Date#(inscription,'DD/MM/YYY') as inscription,
Today() - Date#(inscription,'DD/MM/YYY') as age // you can add Floor() or Round() function to load it as integer
(...)
Next in sheet please add histogram to display age in buckets. One way is to set dimension manually (it is like this in QlikView):
class( age, 10 )
In QlikSense is easier just drag and drop "histogram" from left, choose "age" as dimensions and customize it: see here https://www.youtube.com/watch?v=p97tIzZeZeQ
If you still have problems please let me know so I will update post. You can share also more data - model viewer screenshot, loading script or even whole qvf file from QlikSense. There are also other ways to achieve that but it depends on your data. Generally fastest is to calculate age in loading script as in above example.

Invalid Date error when entering record on Sharepoint list Datasheet view

I have a list on Sharepoint 2013. I've often use the Edit this list link to make bulk changes to the list in datasheet view with no problem. Last week I had a bunch of new records I needed to add so decided bulk copy and paste from Excel would be best. However, I get the error "Invalid date/time value. A date/time field contains invalid data. Please check the value and try again." The field is Date/Time with Date only display. The format I copied in was mm/dd/yyyy, which is how it's displayed (I realize there's a difference between formatting and display). In the past I've used this format to update dates with no problem. I've tried manually changing the date to other formats like yyyy/mm/dd (or with dashes -), and using the date picker and nothing works. I can add a new item using the form and no problem with the date. It's only happening in datasheet view.
I have 70+ records to add and would rather not have to open a new form for each one (I'm only adding info to 7 of the fields, and I first only pasted a couple records to make sure there were no issues). Are there any recent known issues about date fields in datasheet view? It's a pretty straightforward thing, no calculations are being used, I'm not trying to connect to another service, or use outlying dates (dates are all 2017) so I'm perplexed why this is an issue now and not before. Any thoughts on this would be appreciated.
Found the issue. I had another date field I was not using in that view that for some reason the default value had been set to Calculated field with a value of 1/1/1111. No idea how that got there but I removed that and set the default value to None and now the problem is gone. I found it by creating a new view with every date field in the list and systematically copying a date into each field (in bulk edit) and trying to save after each one until it saved. Then I checked the settings for the field that I was able to save with.

Display 0 when no data in dates in Tableau

A lot of people have problems with displaying null values in dates in graphs in Tableau. Tableau automatically joins values that actually exist for specific dates and neglects missing data. I've solved this problem converting my datetime date to a date itself (makedate). Then I right-clicked on the date axis and clicked Format. Clicked "Pane", Special Values -> Text: 0, Marks: Show at Default Value. Next I clicked on Date pane in Columns and made it discrete. This unblocked the possibility to Show Missing Values. I right-clicked on Date axis and chose this option. I clicked on Nulls on the Graph and chose to show them at default values. Finally, I converted Date pane back to Continuous.
Hope this helps someone.
You could try this formula using IFNULL function
IFNULL(MONTH([DATE]),0)
Another function you can use is ZN() instead of IFNULL() which does the same thing as above, except that the default value of zero is baked into the function.
I'm not sure that a formula that returns zero for a date makes sense in most applications though. Sometimes it is better to leave the nulls and then decide how to visualize them. Otherwise, you are masking missing information and replacing it with possibly misleading information.
More info here