FInd min Date in a date range with duplicate date - excel

Using Excel and I'd like a formula that will return the earliest date from a row that contain duplicate date.
for example:
my row has 5 different dates, 1 duplicate and one blank cell
A B C D E F
09/01/2021 08/28/2021 09/08/2021 blank cell 09/01/2021 08/15/2021
I am using formula =MIN((A1:F1)
the return should be "8/28/2021" but I'm getting "1/1/1900"
can someone please help? that will be greatly appreciated

Try this:
=MIN(IFERROR(A1:F1*A1:F1/A1:F1,99999))
It will replace all the 0's with 99999 if it cannot be divided by itself (0).
(99999 is actually 10/13/2173 and was chosen at random as a date that will be later than the other dates on your list.)

You can do it with SMALL function:
SMALL function
My formula in column J is =SMALL(A1:G1;1)
Notice my date format is dd/mm/yyyy

Related

How to assemble Offset function with Condition?

I Have date data in Column A and values data in Column B.
My aim goal is that for each date in column A :
look if one value (column B) during 1 year is less than 90% of the corresponding Value of the date.
This is my data:
Output example :
I start at the first date (31/12/1986) and see the 900.82 value.
I calcul 900.82 * 0.9 = 810.73
So i look if value in line 3 is inferior to 810.73,
If not
I look if value in line 4 is inferior to 810.73,
line 5, 6, 7 ,8..... during 1 year (that mean I stop this the 31/12/1987).
If it is
I stop and i look the next date (01/01/1987) and do the same.
I am agree to translate it in VBA code, but it could be better on Excel.
I first tried an algo to understand the problem :
-Look the first date in column A
-Look the corresponding value in Column B and save it as Value
-Offset to the next date in column A
-Look the corresponding value in Column B and save it as Range.to.compare
-If Range.to.compare < Value * 90% then write "ok" in Column C
-Else, Offset to the next date in column A...
-Untill 1 Year (Untill Year(Date in Column A)<Year(Date in Column A) +1
I try to translate it in Excel or VBA.
This this what I tried by Excel :
But it works only for 1 day instead of 1 year
I think this is what you're after. I broke the calculation into multiple columns to show the steps.
First I calculate the 90% value, in column C.
Column D is where most of the magic happens. In column D I find all rows that have a date < the current date + 1 year, and get the value (Col B) for each of those rows. I then take the minimum of all those values. Note this is an array formula so you need to press shift-ctrl-enter after you type it in.
Now that I have the minimum from the each range, I just need to compare that with the 90% value.

IF statement formulas

Need assistance with creating a formula to calculate how many days of storage. The attached image of a spreadsheet that I use shows an array of dates.
I need a formula in column "E" "Live Days in SIT" that calculates the following:
1st: If column D & C have dates, subtract column D from C
2nd: If all columns have date, subtract column D from C
3rd: If column C is only cell with dates, subtract Todays date from column C
4th: If column C & B have dates, then subtract B from C
5th: If column C & A have dates, then subtract A from C
6th: If column A, B, C have dates, subtract the lesser dates from columns A & B from C
This is the formula I have created, but I receive a "False" statement when only column C has a date:
=IF(L4758=0,IF(J4758=0,IF(I4758=0,TODAY()-K4758)),IF(L4758>0,L4758-K4758,IF(L4758=0,IF(I4758=0,IF(J4758>0,J4758-K4758,IF(J4758<I4758,IF(J4758>0,J4758-K4758,IF(J4758>I4758,IF(I4758>0,I4758-K4758)))))))))
Thank you!
Try,
=if(count(a2:d2)=4, c2-d2, if(count(a2:c2)=3, c2-min(a2:b2), if(and(count(a2:d2)=2, c2<>0), c2-sum(a2, b2, d2), text(,))))
There are still some 'holes' in your logic but I suppose those are conditions that will never be met.
This should work, but I got a little confused as to which column should be subtracting from which. I followed your verbal commands, but my intuition says you probably are looking for a different method than the one you described. Here it is, you can adjust if need be.
=IF(AND(C6<>"",D6<>""),C6-D6,IF(AND(D6<>"",C6<>"",B6<>"",A6<>""),C6-D6,IF(AND(D6="",C6<>"",B6="",A6=""),C6-TODAY(),IF(AND(C6<>"",B6<>""),C6-B6,IF(AND(C6<>"",A6<>""),C6-A6,IF(AND(A6<>"",B6<>"",C6<>""),IF(A6>B6,C6-B6,C6-A6)))))))

How to include cells with today date in SUMIFS formula

I've got raw data in a sheet with columns containing items number, product type, date, etc...
Date format is: 25-01-18 9:20
I'm trying to get a SUMIFS formula to report number of items arrived today.
Like =SUMIFS(Sheet2!G1:G924,Criteria1,Criteria2,etc)
Any idea?
Thanks in advance
If there are times in the data you can do >= today and < today+1 to count all items on todays date, e.g. if your date/times are in column H this sums column G for all today's items
=SUMIFS(Sheet2!G:G,Sheet2!H:H,">="&TODAY(),Sheet2!H:H,"<"&TODAY()+1)
Or for a simple count of today's items
=COUNTIFS(Sheet2!H:H,">="&TODAY(),Sheet2!H:H,"<"&TODAY()+1)

excel extract 6 digits from number, format as date and match with index match?

I have the following 2 worksheets.
Data:
Column B Column C Column D COLUMN E Column F
329115121601 3291 5555 =Date (MID(B8,9,2),MID (B8,7,2),MID (B8,5,2)) 50 <---- Week Number from date
I am trying to extract 6 digits from my number value in Columb B '151216' and want to put this into column E. The 6 digits represent a date which is 15th December 2016.
I am using mid to try and get the number and then date to try and format this as 15/12/2016 - however it's not working. Instead I get 15/12/16.
On my other sheet, 'Home' i am trying to look up the number from column B on sheet 'Data' using an index match (array formula) where the values in column C, D and E or F match.
Home:
Column H Column I Column J Column K
3291 5555 15/12/2016 or Week 50 {=IFERROR(INDEX(Data!$B:$B,MATCH(1,(Home!$H10=Data!$C:$C)*(Home!$I10=Data!$D:$D)*(IF(Home!$J10<55,Home!$J10,WEEKNUM(Home!$J10))=Data!$F:$F),0)),"No Po Found")}
The user should be able to enter either week number or a specific date and get a result.
For some reason, this formula works if the user enters a week number, but not if they enter a specific date. I'm not sure if this is a format issue with the date on sheet 'data' or with the index match formula. Please can someone show me where I am going wrong? Thanks
Excel defaults to 1916 when I input your formula, try adding "20"& to the start of the year parameter:
=Date("20"&MID(B8,9,2),MID(B8,7,2),MID(B8,5,2))
I think you are doing it well. Just need to format the date.
Right click on the cell that contains the date ( 15/12/16 ) then click on cell formatting option and choose the format you prefer.

How do I match a date from a list of dates in Excel?

I need to compare two dates to see if they are equal from a list of dates in a column.
Eg. Sheet 1 Column A
Date 1
Date 2
Date 3
Date 4
Sheet 2 : Row F: Date 5
I want to see if date 5 is equal to any of the dates in column A and return true.
Please help me with this.
An alternative approach:
Assume Date1-Date4 are in A2:A5, and Date5 is in B2:
{=OR(B2=A2:A5)}
Note that you need to enter the formula as an array formula using Ctrl+Shift+Enter.

Resources