Search data between dates and name in Excel - excel

I have a problem where i need to get the last section through between dates and Name
i try this formula but it only search for exact date
=LOOKUP(G2,A1:A5,C1:C5)
it gives me a answer of #N/A
and also i dont know how to search it by name

As you are using Excel-2010 then try below array formula.
=INDEX(C1:C5,LARGE(IF((A1:A5>=G2)*(A1:A5<=G3)*(B1:B5=G4),ROW(C1:C5),""),1))
Array formula need to put with CTRL+SHIFT+ENTER.
If you have Excel365 then can try XLOOKUP()
=XLOOKUP(1,(A1:A5>=G2)*(A1:A5<=G3)*(B1:B5=G4),C1:C5,,0,-1)

Related

Excel - INDEX/MATCH with MAX and Criteria - Boolean logic

Please see screen grab. I am using Excel 2010. My result is needed in cell G4 which I will fill down to G14.
I am looking at the left table to match "Swindon" and the MAX value of "Net". So in this example, I would expect the result to be "Walters" from the "Name" column.
I am attempting to use two INDEX and a MATCH with some boolean logic on the two internal arrays on the second INDEX where it matches 1. However I cannot seem to get this formula working. Where am I going wrong? Please note: I am avoiding an array formula.
Thanks for looking.
If the values are unique as you say then you could use MAXIFS, INDEX and MATCH:
=INDEX(B:B,MATCH(MAXIFS(D:D,C:C,F4),D:D,0))
Find the max value where Swindon is in column C then use this value in index match.
2010 version would be AGGREGATE instead of MAXIFS:
=INDEX(B:B,MATCH(AGGREGATE(14,6,D:D/(C:C=F4),1),D:D,0))
With Excel2010 try below array formula-
=IFERROR(INDEX(Table6[Name],MATCH(MAX(IF(Table6[Location]=[#City],Table6[Net],""))&[#City],Table6[Net]&Table6[Location],0)),"")
Press CTRL+SHIFT+ENTER to evaluate the formula as it is an array formula.
With Excel365 you can try-
=#IFERROR(SORT(FILTER(Table6,Table6[Location]=[#City]),3,-1),"")

Excel Sumif with number

=SUMIF(A1:A14, "102000*", B1:B14)
Why it cannot filter the value starts with 10200?
An array (CSE) formula solves the issue:
How it works:
Suppose you want to add numbers like 1020001, then enter it as criteria in cell D74, and use this formula.
{=SUM((B74:B82)*(--(A74:A82=D74)))}
If you have more criteria, like I've shown in D74 & in E74, then use this one in C74.
{=SUM((B74:B82)*(--(A74:A82=D74)+(--(A74:A82=E74))))}
N.B.
Finish formula with Ctrl+Shift+Enter.
You may adjust cell references in the formula as needed.
You are better off creating a new column using the formula
left(a1,5)
Then base the sumif off that new column.
If you want to count the number of occurences, you can use
=SUMPRODUCT(--(--LEFT(A1:A7,5)=10200))
and if you actually want to sum values, use
=SUMPRODUCT(--(--LEFT(A1:A7,5)=10200)*(B1:B7))

Excel formula or vlookup to pick latest date?

i am using vlookup and want to have the latest date to be picked from multiple entries as listed below, please advise if any one can help in this regard.
Now i want to pick latest date for ALi, Mubeen and Nadeem from the corresponding column of date. e.g i can pick Ali and latest date for this one is 5-Dec-20.
Please advise.
i think if your concern is only for Min value, then best method will be to do it by pivot tables.
Drag name to columns and date to values in pivot tables. Now convert the date value to Minimum. This will get the things done.
Hope the query is clear.
You can use following array formula:
=MAX(IF($A$2:$A$10=D2,$B$2:$B$10))
Array formula after editing is confirmed by pressing ctrl + shift + enter
You can put all the dates in a hidden column and get the min value like this:
The red cells formula: =IFERROR(INDEX($B$3:$B$13, SMALL(IF(D$2=$A$3:$A$13, ROW($B$3:$B$13)-2,""), ROW()-2)),"")
The blue cell formula: =MIN(D3:D6)
You can use the MAXIFS function,
=MAXIFS(B3:B6,A3:A6,C2)

Using Vlookup inside Sumproduct

I have a table named "Open" that contains values of DPL_900, DP_950, etc. I want to calculate the sum of multi between quantity and each value of DPL_900, DP_950 which "Vlookup" in Open table. So I typed in the cell K98 that formula:
{=SUMPRODUCT(K93:K97,VLOOKUP(L93:L97,Open,2,0))}.
I thought that formula would work but it does not.
I think you do not need any VLookup(). Use following formula. Here Open is table name with header.
=SUMPRODUCT(B2:B6,(Open[Cat]=C2:C6)*Open[Num])

Data validation gives error normal cell doesnt

I have this formula
=OFFSET(Products[[#Headers];[Merk]];
MATCH(A2;Producten!$A:$A;0)-1;1;COUNTIF(Producten!$A:$A;A2);1)
It works fine in a normal cell. But as soon as I putt it in the Data Validation>List I get the error.
There is a problem with this formula.
Not trying to type a formula?
Does anybody know what the problem is?
Suggest to change the reference to the Table for the cell address (e.g. assuming the table starts at B6 and Merk is the 1st field then change Products[[#Headers];[Merk]] for B6).
Not all formulas that are valid for Cells are accepted by DataValidation, particularly when they refer to a ListObject for example the formula COUNTA(Products[Merk])is valid in a Cell but not accepted by DataValidation
Formula should be:
=OFFSET(B6;
MATCH(A2;Producten!$A:$A;0)-1;1;COUNTIF(Producten!$A:$A;A2);1)
When referring to a table in a validation formula you cannot refer directly to a table and must use intermediate names.
For example, define a name like this:
_name_Product that is equal to: ="Products[[#Headers];[Merk]"
Then use INDIRECT in the formula:
INDIRECT(_name_Product)
or use entries like INDIRECT("Products[[#Headers];[Merk]")
Hope this helps.

Resources