Excel table function: if then or - excel

i am crunching a large dataset. one column is "date". i want to have a column of Invoice Date. for any transaction happened in january, i want the invoice date to be Jan-31-2017...so on and so forth.
Jan 2, 2017 (invoiceDate Jan 31, 2017)
Jan 18, 2017 (invoiceDate Jan 31, 2017)
Feb 5, 2017 (invoiceDate Feb 28,2017)
......
How to write the If function? thanks.

use the EOMONTH() function
=EOMONTH(A2,0)

Related

How to grab the running total of the first day of the month?

I'm trying to write an Excel function to grab the value of the Running Total in rows that are on the first of the month in the Date column. Where there are more rows with the same date, I want to grab the last value. (The dates are in ascending order.)
This is an example of the kind of table I'm using:
Income
Running Total
Date
$1,000.00
$1,000.00
Jun 30, 22
-$60.00
$940.00
Jul 01, 22
-$42.00
$898.00
Jul 20, 22
-$55.00
$843.00
Aug 01, 22
-$200.00
$643.00
Aug 01, 22
-$60.00
$583.00
Aug 19, 22
-$20.00
$563.00
Sep 01, 22
$334.00
$897.00
Sep 10, 22
-$610.00
$287.00
Oct 01, 22
-$50.00
$237.00
Oct 02, 22
I have a formula for calculating the running total and the date is created with the DATE() function.
I'm planing to use the function in a new table on the same sheet. In each row is the running total of the first of that month.
Month
Amount
Jul
Aug
Sep
Oct
The problem is that I'm expecting this table to grow and I don't want to manually search each row. I would like to have a function that goes through the Date column and identifies if it contains the date of the first day of the month, if it does, get the running total.
I have attempted something like this:
=CONCAT("$B",MATCH(”Jul 01, 22”,$C1:$C100,1))
But I don't know how to create the function or whether or not this works.
How can I write a function that grabs the Running Total on the first of the month?
You can use either INDEX() & MATCH() or XLOOKUP()
• Formula used in cell F2
=INDEX($B$2:$B$11,MATCH(DATE(2022,MONTH(E2&1),1),$C$2:$C$11,1))
Or,
• Formula used in cell H2
=XLOOKUP(DATE(2022,MONTH(E2:E5&1),1),C2:C11,B2:B11,,1,-1)
or, can exclude the 5th parameter, of XLOOKUP() as well
• Formula used in cell H2
=XLOOKUP(DATE(2022,MONTH(E2:E5&1),1),C2:C11,B2:B11,,,-1)

How fetch record within date range with multiple date range in excel

I have two excel sheets, I am trying to find all user details along with request IDs that are accessed on a particular date and time range.
Sheet 1: Request
A
B
C
D
E
User
Request ID
Startdate
enddate
Business reason
100
1234567
Jul 01, 2022 03:24:11
Jul 01, 2022 06:10:11
SRQ123456
101
1234568
Jul 01, 2022 06:24:11
Jul 01, 2022 08:24:11
CHG123456
Sheet 2: Access details
A
B
C
D
OBJECTNAME
ACTION
ACCESSBY
ACCESSTIME
Business User
Update
100
Jul 01, 2022 05:59:12
Workflow
Update
100
Jul 01, 2022 06:05:20
Roles Add Workflow
Update
100
Jul 01, 2022 06:10:32
SFA
Delete
101
Jul 01, 2022 06:24:12
Tried the below code result to find out the record within the date range but I am not able to get the entire row details of sheet1:Request. I have used Name manager from the formula to store the value of Startdate, enddate, and User.
=IF(COUNTIFS(Startdate,"<="&D3,enddate,">="&D3,User,C3)>0,"Yes","No")
Sheet 2: Access details
A
B
C
D
E
OBJECTNAME
ACTION
ACCESSBY
ACCESSTIME
Business User
Update
100
Jul 01, 2022 05:59:12
Yes
Workflow
Update
100
Jul 01, 2022 06:05:20
Yes
Roles Add Workflow
Update
100
Jul 01, 2022 06:10:32
No
SFA
Delete
101
Jul 01, 2022 06:24:12
Yes
The expected output in Sheet2 should be as below
A
B
C
D
E
F
G
H
I
J
OBJECTNAME
ACTION
ACCESSBY
ACCESSTIME
User
Request ID
Startdate
enddate
Business reason
Business User
Update
100
Jul 01, 2022 05:59:12
Yes
100
1234567
Jul 01, 2022 03:24:11
Jul 01, 2022 06:10:11
SRQ123456
Workflow
Update
100
Jul 01, 2022 06:05:20
Yes
100
1234567
Jul 01, 2022 03:24:11
Jul 01, 2022 06:10:11
SRQ123456
Roles Add Workflow
Update
100
Jul 01, 2022 06:10:32
No
Record not matched
SFA
Delete
101
Jul 01, 2022 06:24:12
Yes
100
1234568
Jul 01, 2022 06:24:11
Jul 01, 2022 08:24:11
CHG123456
There are multiple ways to do this.
I will assume that the date values in both, Sheet 1 and Sheet 2, are formatted as dates and not as text. If that is not the case, additional formulas for conversion to date format will be needed.
You could try the following solution:
=OFFSET(Sheet1!$A$1:$E$1,MATCH(1,($C3=Sheet1!$A:$A)*($D3>=Sheet1!$C:$C)*($D3<=Sheet1!$D:$D),0)-1,0)
However, there is no error handling embedded here yet which leads to an error for the 3rd row of data on sheet 2 with the example data that you provided. The date and time of the "access" in the 3rd row is not within the given start and end dates of that "user" on sheet 1 (screenshot for clarification)
Therefore, for those 4 rows of data the formula will return the following result:
If you want the formula to return something else than the #N/A error, use the =IFERROR(value,value_if_error) function, where 'value' would be the formula above.

Convert date format from dd/mm/yyyy to mm/dd/yyyy?

I have the following dates on my Excel sheet.
02/01/2017
02/02/2017
02/03/2017
02/07/2017
2/15/2017
2/16/2017
I want it to read as Feb 1, Feb 2. etc however Excel reads the dates as January 2, 2017, Feb 02, 2017, March 02, 2017.
How do I do this? Help please.
This is a built in function in Excel. Try from the ribbon above,
Number Group > More Number Formats > Date > Your desired Format
If you're looking for more customizability, try separating them by the / symbol using text to columns function from the Data tab in the ribbon.
This is what I got from punching in your data:
February 1, 2017
February 2, 2017
February 3, 2017
February 7, 2017
February 15, 2017
February 16, 2017

Two conditions have to be true then be counted

I'm working on a spreadsheet that two conditions have to true in order to be counted. If the month is January, and the number next to it is less than or equal to 30, then it's counted. Same rule applies for all the other months.
Thus far, I have:
=COUNTIFS(Sheet1!D2:D7,(SUMPRODUCT(--(MONTH(D2:D7)=1))),Sheet1!E2:E7,(COUNTIFS(E2:E7,"<=30")))
For example:
Column D
Jan 1, 2014
Feb 3, 2014
Feb 16, 2014
Mar 5, 2014
Mar 13, 2014
Mar 29, 2014
Column E
37
25
30
31
1
16
Outcome
Jan 0
Feb 2
Mar 2
It's fairly easy. Try this:
{=SUM(IF(MONTH($D$2:$D$7)=1,1,0)*IF($E$2:$E$7<=30,1,0))}
Of course you can replace the =1 part with a reference to a cell with the month number or even =MONTH(H2), for example, given a cell with a date in it so you can build your formula as a table.
Note: the only trick to this is that the formula must be entered as an array formula. So do CNTL+SHIFT+ENTER when entering in the formula.

Excel Doc Sum row b where row a in between dates

I have a google spreadsheet having data as below
Date SomeVal
Aug 01, 2013 1
Aug 02, 2013 5
And so on. I want to have another sheet with Monthly grouping as follows(This is what I want in the end but unable to get here)
Month Total
Apr 2013 200
May 2013 300
I tried following but could not get correct result
=SUMIFS(Sheet1!B:B,Sheet1!A:A,ʺ> Aug 1, 2013ʺ) //Returns SUM(B:B) as all dates are above Aug 1 2013
=SUMIFS(Sheet1!B:B,Sheet1!A:A,ʺ< Jun 1, 2014ʺ) //Returns 0 which is wrong
This is what I expected to get
sum for which date > Aug 2013
sum for which date < Jun 2014
My date format is Mon DD, YYYY
Any idea Where I am wrong
This format works for me
Raw Data in Sheet2
(Column A) (Column B)
Date Val
----------- ---------
7/1/2013 1
7/2/2013 2
7/3/2013 3
7/4/2013 4
And so on and so forth up until 2/9/2016 (as long as they are date values you can format them however you want)
Summed Data in Sheet1
(Column A) (Column B)
Month Total
---------- ---------
Jul 2013 496
Aug 2013 1457
Sep 2013 2325
Oct 2013 3348
Nov 2013 4155
So on and so forth for each month that I want, using this formula. Each month is formatted as MMM YYYY, and the date is the first of the month (7/1/2013, 8/1/2013, etc...)
=SUMIFS(Sheet2!$B:$B,Sheet2!$A:$A,">="&Sheet1!$A2,Sheet2!$A:$A,"<"&Sheet1!$A3)
This says
Sum the range in Sheet 2 Column B where:
The date in column A of that row is greater than the first of the month supplied
The date in column A of that row is less than the first of the month afterwards

Resources