Return last entry by month - excel-formula

I'm trying to get the last value of each month of the year, but when I enter other dates from different ages the result doesn't match, it gets just the value from the last month.
Worksheet Image

Assuming that
I understand your requirement correctly
you don't actually want to try to calculate the value on the last day of a month for which you have no data (E8 & E9)
then you can use the formula below
=INDEX($B$1:$B$16,MATCH(EOMONTH(E4,0),$A$1:$A$16))

Related

Find End & Start Date Double Vlookup Excel

I have thousands of cells of data formated with the headers of
UID, Date, Mass, Start / End, Float Days, Days from Start
I have a simple version of what the sheet looks like below:
Each new data entry is entered as a row.
The data for each UID ( unique ID) is taken on non-consistent days over the length of its float life. (ex: wood floats and I take its mass on different days until it sinks).
I want to Identify a "Float Days" by taking the Sink date and subtracting it by the first reference of the ID.
#simple:
When the row has "1" in the D column, Find the ID on that row, then find that ID when that row has "0".
Take the date from that row and subtract by sink date to give me float days
#complex:
=IF(D16="1", (vlookup(A16 & "0",$A$1:$F$999,2,0)-B16, "")
If possible, I would like to use the framework of the formula to also calculate each data-inputs date in days from its Start Date as shown below:
#simple: in row E
Take the date from current row (row 10 for example), find that ID's start date,
subtract from one another to give me days from time=0
#complex:
=B10-vlookup(A10 & "0",$A$1:$F$999,B,0)
I am confused as to whether I am typing the formula incorrectly or if there is another and easier way to do this.
Thank you!
SUMFIS is the better choice here. In cell E2 and copied down:
=IF(D2=1,B2-SUMIFS(B:B,A:A,A2,D:D,0),"")
If you want a same day start/end pair to be equal to 1 instead of 0, just add a +1 to the end of the SUMIFS.

Filiter Data by get the first day of the month in Excel

This command line gives the last work day of the month (True or False). I don't know how to change the commands to get the first work day of each month. If we are assuming the entire column A is the Date. format is mm/dd/year
AND(WEEKDAY(A2,2)<6,MONTH(WORKDAY(A2,1))<>MONTH(A2))
The first day of the month is
date-DAY(date)+1
In your case:
A2-DAY(A2)+1
To check weather A2 is the first day of its month:
A2 = A2-Day(A2)+1
'Simplify equation
Day(A2) = 1
So as a result =(Day(A2)=1) evaluates to True/False
Regarding your formula weather a date is the last day of the month, that can be done by:
=(A2=EOMONTH(A2,0)
I believe this is what you're looking for
=DAY(A2)=1

Count total number of workers based on today's date updating automatically every day

I'm a bit stumped on how to create a formula that can count the total number of workers today and update automatically every day.
Looking at the image below, I want to create a formula that will look at Row 10, determine today's date and look at Row 39 to determine how many workers I had for that day.
For example, if I look at today's date on the image Cell AZ10 and then scroll down and look at total workers for the day Cell AZ39 it should be 6. When the next day comes, 2018-03-05, I would like the cell to automatically update to the number of workers for that day, which would be 7.
Any help would be greatly appreciated. Thank you!
You can use the HLOOKUP function (Horizontal Lookup) to obtain the value you require.
For example, assuming that your data occupies the range from AZ10 to BZ39, the following formula will obtain the number of workers present today:
=HLOOKUP(TODAY(),AZ10:BZ39,30,FALSE)
Here the arguments are as follows:
TODAY() returns today's date
AZ10:BZ39 is the range of cells whose first row contains the lookup value and which also contains a row whose value is to be returned.
30 is the number of row whose value is to be returned (relative to the supplied range).
FALSE means there must be an exact match between the cell value in the first row of the supplied range and the supplied lookup value.
The HLOOKUP function is looking along row AZ for a value which exactly matches (because of the FALSE parameter) today's date (as returned by TODAY()). If such a value is found, the function will then return the value found in row 30 of the range - that is, in row 39 of your worksheet.

Excel add one month to a date ensuring it does not fall on a weekend

I have some workday in cell A1, say 25/07/2013. I add one month using the formula
edate(A1,1), returning 25/08/2013 which is a weekend. How do I ensure that the next business day is returned instead?
You can check out this link: http://office.microsoft.com/en-001/excel-help/workday-HP005209339.aspx on the function WORKDAY which will return the next-n-working day.
It's tempting to do Workday(A1,0) to find the next working day after date specified in A1, but it's not doing the job.
So we need to do this trick:
=Workday( edate(A1,1)-1 , 1 )
the result is a number representing the serial number of the next working day.
The trick is you consider the previous day, then find the next working day after it. So if the date is a working day, it will return it, while if it is not a working day, it will return the next one.
I hope Microsoft modifies this method, though, so that when you enter workday(A1,0) it will return the next working day automatically.
So for example you want to find the next working day one month after 27-Jun-2013 (which would be 27-Jun-2013, but that's Saturday, so it should return 29-Jun-2013 instead):
=Workday( edate(date(2013,6,27),1)-1 , 1 )
will return you 40022, which refers to the date 29-Jul-2013, which is the next working day.
To get the formatted result as 29-Jul-2013, you need to format your cell with Format->Cell->Date
shortest formula I can find :
=WORKDAY(WORKDAY(edate(A1,1),-1),1)

Check if any date within a range is within 1 month of todays date

I've got a column full of dates. How can I check that column to find which date is within a month of todays date, and then return it?
If there is no date within a month, just return blank
Lets say my dates are:
01-Jan-12
01-Apr-12
01-Jul-12
01-Oct-12
01-Jan-13
The code im using is below. A:A is the range of the dates above
=MIN(IF(A:A>TODAY(),A:A))
The issue im having is that if I use the above, it returns 01/01/12 and not 01/01/13. Also, if I change the dates so the next date is December 1st 2012, it still returns 01/01/12
So you really just want the earliest date if that's within a month? If so perhaps try
=IF(MIN(A:A)-TODAY()<=30,MIN(A:A),"")
Assumes dates in column A
If you have past and future dates try this formula
=IFERROR(SMALL(IF(A2:A100>=TODAY(),IF(A2:A100<=TODAY()+30,A2:A100)),1),"")
confirmed with CTRL+SHIFT+ENTER
or for exactly 1 month (rather than 30 days) try using EDATE, i.e.
=IFERROR(SMALL(IF(A2:A100>=TODAY(),IF(A2:A100<=EDATE(TODAY(),1),A2:A100)),1),"")

Resources