How to make A column of spreadsheet display the name of the month, which index is the row? - google-sheets-api

Create an empty google spreadsheets. Enter following
=ROW() =MONTH(A1)
=ROW() =MONTH(A2)
=ROW() =MONTH(A3)
=ROW() =MONTH(A5)
output:
1 -January-
2 -December-
3 -December-
4 -December-
5 -December-
6 -December-
7 -December-
8 -December-
9 -December-
10 -December-
11 -December-
12 -December-
Is there a workaround?
Seems like a ridicolous bug/intentional bad design choice in Google Spreadsheets
Naturally, =MONTH(=ROW()) does not work correctly either

1/1/2021 -January-
2/1/2021 -February-
3/1/2021 -March-
4/1/2021 -April-
5/1/2021 -May-
6/1/2021 -June-
7/1/2021 -July-
8/1/2021 -August-
9/1/2021 -September-
10/1/2021 -October-
11/1/2021 -November-
12/1/2021 -December-
solution is formatting. first, format first row and put validation as a date. then, format second row as a date (month only, verbal). then enter first two dates. then autofill the rest of date by selecting first two and grabbing the corner of the selection (autofill A column)
then enter =A1 to B1, and autofill B column too

Related

Read a specific value from a table

I want to enter a value from a range 'from-col' - 'to-Col' e.g. 1371 and want to get the only index value: 27.89 from the value column
The value is entered as input via a search box in my Android app
The table looks like this:
id
from
to
value
1
0
1339.99
0
2
1340
1349.99
6.89
3
1350
1359.99
13.89
4
1360
1369.99
20.89
5
1370
1379.99
27.89
6
1380
1389.99
34.89
7
1390
1399.99
41.89
8
1400
1409.99
48.89
9
1410
1419.99
55.89
I tried it with Between and also with >= and <=. I don't get along with any of the WHERE conditions.
I am grateful for any reference

How do I sort column by targeting a specific number within that cell?

I would like to use Pandas Python to sort a specific column by date (more specifically the year). However, the year is buried within a bunch of other numbers. How do I just target the 2 digits that I need?
In the example below, I want to sort this column by the numbers [16,14,15...] rather than considering all the numbers in that row.
3/18/16 11:46
6/19/14 14:58
7/27/15 14:22
8/3/15 12:59
2/20/13 12:33
9/27/16 12:08
7/27/15 14:22
Given a dataframe like this,
date
0 3/18/16
1 6/19/14
2 7/27/15
3 8/3/15
4 2/20/13
5 9/27/16
6 7/27/15
You can convert the date column to datetime format and then sort.
df['date'] = pd.to_datetime(df['date'])
df = df.sort_values(by = 'date')
The resulting dataframe
date
4 2013-02-20
1 2014-06-19
2 2015-07-27
6 2015-07-27
3 2015-08-03
0 2016-03-18
5 2016-09-27

Removing duplicates from many excel sheets

I got a question if there is any fast way to remove duplicate rows across two excel spreadsheets. After searching I can do it by comparing the same rows in the spreadsheets (VBA). But I want to check whether the row from one is included anywhere in two. If exactly the same row exists in two it should be removed. So far I can do it if they are the same rows (e.g. 1 and 1).
Thanks in advance for any kind of help.
I can think of a workaround for this:
Create a column at the end of each row which is concatenation of all the columns of that particular row: Lets sat below are the two tables on the two excel sheets:
sheet1
A B C D(Concat)
1 2 3 123
4 5 6 456
7 8 9 789
1 3 5 135
4 3 2 432
sheet2
A B C D(Concat)
2 3 4 234
1 1 1 111
1 2 3 123
2 2 2 222
4 5 6 456
We will now identify the duplicate rows based on the last concatenated column. Using the formula =IF(ISNUMBER(MATCH(D4,Sheet1!D:D,0)),"DUP","NONDUP") in the second sheet, we can identify the rows which are already present in sheet1 irrespective of the sequence of the row in sheet1 wrt sheet2.
Result on Sheet2 shows up as below:
A B C D E(Result)
2 3 4 234 NONDUP
1 1 1 111 NONDUP
1 2 3 123 DUP
2 2 2 222 NONDUP
4 5 6 456 DUP

multiple data validations excel macros

I need to consolidate the following two data validations into one condition
Validation formuala
Here is the full formula from the image:
((86400*((E5-D5)+(E6-D6)+(E7-D7)+(E8-D8)+(E9-D9)+(E10-D10)+(E11-D11)))/3600)+(7.5*SUM(G5:G11))<=37.50
Workbook
I assumed I needed VBA to do this, please advise if at all possible
Thanks
As mentioned in comments, you can use data validation to take care of the timestamps.
To enforce the condition "put any number of worked time in excess of 37,5 hrs into overtime", you can use two formulas to solve this.
Assuming a workbook looking roughly like this:
A B C
1 Days Hours Hours
2 Monday 8 8
3 Tuesday 8 6
4 Wednesday 8 7
5 Thursday 8 5
6 Friday 8 3
7
8 Regular
9 Overtime
10 Sum hrs
In cells B8 and C8, use this formula (enter it in to B8 and copy it to C8):
=IF(SUM(B$2:B$6) > 37,5; 37,5; SUM(B$2:B$6))
In cells B9 and C9, use this formula (enter it in to B9 and copy it to C9):
=IF(SUM(B$2:B$6) > 37,5; SUM(B$2:B$6) - 37,5; 0)
The workbook from above will then look like this:
A B C
1 Days Hours Hours
2 Monday 8 8
3 Tuesday 8 6
4 Wednesday 8 7
5 Thursday 8 5
6 Friday 8 3
7
8 Regular 37,5 29
9 Overtime 2,5 0
10 Sum hrs 40 29
This can be adapted (with some changes to the formulae) to work with a scenario where you put "Started work" in one column and "Ended work" in another column. If you show me how your workbook looks, I can see about making such a change for you.

Need to delete partial rows in excel using vba

I have an excel sheet, in which i need to delete partial data from rows for some columns for further processing using vba. Any suggestions would be great.
Thanks,
Raw data:
**A** **B** **C** **D**
1 2 3 4
1 2 5 6
1 2 7 8
2 3 8 9
2 3 5 7
Expected data
**A** **B** **C** **D**
1 2 3 4
- - 5 6
- - 7 8
2 3 8 9
- - 5 7
If the idea is purely to delete repeating data you could evaluate each cell, look at what row your in, look at the range below that cell, find first and clear it, repeat until your find first returns nothing.