excel formula to extract dates with highest trade count - excel

I need excel formula to show the dates when the trade count was maximum. Below mentioned are the excel columns
trade count. date
10 9 jan
12 8 jan
12 7 jan
Result : 7 jan & 8 jan
so the result can be highlighted in two different rows. or whatever convenient format.
kindly advice how it can be done easily.

Let your column C provide you with all the dates on which the MAX happens. You can always hide column C later.
Let C1 be the maximum from column A:
=MAX(A:A)
Now in each row, column C can build up your final output string. Copy from C2 down:
=IF($C$1=A2,TEXT(B2, "dd mmm"),"")
This gives you a column of either blank values, or the dates you need (correctly formatted as text).
Use column D to build up your final output string, by looking down column C:
=IF(C2="",IF(D3="","",D3),IF(D3="", C2,D3&" & "&C2))
Your result string will be given by cell D2.

Related

I need to retrieve the date from the row that will deplete my inventory

This is hard to explain...
I have a report that I pull from our MRP system that gives me a Due-Date, a quantity required, and an item number. There will usually be several rows with the same item number each representing a different sales order.
I have another report that gives me the on hand quantity for each item. In this report, each item is listed only once.
I need to get the Due-Date that corresponds to the row that will use up the last of my inventory. (Inv. runout)
Due-Date
QTY-REQ
ITEM
4/27/21
5
C
4/28/21
7
A
4/29/21
5
B
4/30/21
1
B
5/1/21
13
A
5/2/21
4
A
5/3/21
12
C
5/4/21
1
A
OHQ
ITEM
INV. RUNOUT
10
A
formula here, Result should be 5/1/21
5
B
result should be 4/30/21
10
C
result should be 5/3/21
I hope this makes sense, if not, please let me know what I can answer to help with this.
-Nick
You'll need a new column on the first report using IF(SUMIFS( to only show the date of lines where the stock runs out at or before that date. Then in the second report, use MINIFS(), a fairly new function, to find the earliest date in that column that matches each product.
In the below example I'm assuming that both of the above reports shown are columns A B and C, in the same excel file, on sheets called Report1 and Report2.
In cell Z2 on Report1, enter the formula IF(SUMIFS(B:B, A:A, "<=" & A2, C:C, C2) > INDEX(Report2!A:A,MATCH(Report1!C2,Report2!B:B,0)), A2, "") and copy down for all rows. This will only display the date where the stock has run out by that date.
In cell C2 on Report2, enter the formula =MINIFS(Report1!Z:Z, Report1!C:C, Report2!B2) to get the earliest relevant date displayed from the formula above.

Get user input for month and year to populate cells with dates of that month and year in excel

i want to take two inputs from user Year and month and then populate the cells with the dates of that month and year in excel.
for example:
Enter year:2017
Enter month:Jan
Date
1/1/2017
1/2/2017
1/3/2017
1/4/2017
.
.
.
.
the cells should auto populate when the month and year is entered.
thanks for suggestions in advance.
Without context, it's not clear what you need. Do you want the user to enter the data in dialog boxes or enter the data into two cells? What format will the user be expected to enter the dates in? For example, should January be entered as "Jan", "January", "1" etc.? You probably just need to have 31 formulas set up that reference the input cells, but you need to specify exactly how that input is handled first.
EDIT:
That was meant to be a comment, not an answer, so here is my actual answer:
In cell A1, set up a data validation rule. The rule should be a list with the source given as "Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec" or the longer form if you prefer. Now when you try to edit this cell you have the option of selecting from a drop-down list of months.
If you want to limit the year range as well, you can do something similar in cell B1. Just create comma-separated list of valid years in the source field.
Enter the numbers 1 to 31 in cells A3 to A33 then enter this formula in cell B3:
"=DATEVALUE(A3&"-"&$A$1&"-"&$B$1)"
Autofill/copy that down to B33. The DateValue function takes the calculated string (for example "13-Feb-2017") and converts it to a date which you can then format any way you want. Note that this will produce the error "#VALUE!" if either of the input cells are blank or if the choosen month doesn't have 31 days, but you can modify it to your own needs.
Assume this.
Cell b1 tooks input as month, create a name range rng
cell d1 tooks input as year, create a name range yearsamp
column I and J have this, with a formula in j3.
=IF(MOD(yearsamp,4)=0,29,28)
month days
1 31
2 29
3 31
4 30
5 31
6 30
7 31
8 31
9 30
10 31
11 30
12 31
name above cell range as monthdays
use this formula in A2 and fill
=IF(VLOOKUP(mnth,monthdays,mnth,FALSE)>=ROW(A2)-1,DATE(yearsamp,mnth,ROW(A1)),"N/A")
This is another option to achieve this
You can use this formula also.set up as said above.
on first field for 1st date enter this on A2
=DATE(d1,MATCH(b1,I1:I12,0),1)
On A3 write this forula and fill
=IF(ROW(a2)-1<VLOOKUP(mnth,mnthdays,2,FALSE),a2+1,"")
As you have 31 cells with formula it return errors when the month day count are less than 31 but this formula show those as blank without errors.

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.

vlook up for multi combination value

Friend.
I have sheet1 like below
Jan Feb Mar Apr
A 10 15 13 10
B 11 11 15 12
C 12 13 15 14
D 12 10 10 15
In Sheet 2! i have 2 scroll scroll down list in cells made by data validation.fist one is in A1 with the values A, B and C, in A2 cell with the values Jan,Feb,Mar.
What i need on this, if i select A and Jan from scroll down list. i need to show the value as '10' in A3 Cell
I tried VLook up with my limited knowlege but i can provide only one value in Lookup value and array.
Please help.
You have to provide vlookup a number of column to return as variable, which you may get as a return value of match function.
Sheet1 has populated range A1:E5, where first row contains names of months (range A1:E1). Sheet2 has only values in two cells A1 and A2.
You need to find in which column of Sheet1 is a month, that is done by
match(a2, Sheet1!A1:E1, 0)+1
and find the value with VLOOKUP.
The final formula would be
=vlookup(a1, sheet1!a1:e10, match(a2, sheet1!A1:e1, 0)+1, false)
EDIT: The first time I messed Sheet1 and Sheet2.

Resources