Multiple If And Statements - excel

I am a novice excel user so I'll explain this the best I can. I need to track Returns, Returns/Exchanges and who processed each...
Cell column A Contains employee Names
Cell column B is where return information will go
Cell column C is where exchange information will go
In B2 I want a formula that will say, if A11:A300 contains 'Ben', and F11:F300 contains 'return', then E11:E300
Does this make sense?
Thanks in advance!

I can't tell if you're attempting to "count" all instances of "Ben" and "return" and collect the total in B2, or if you want to return the value of E11:E300 in B11:B300 when the condition that each row that containing "Ben" and "return" is met.
If it's the former, the this should do it:
=SUM(($A11:$A300="Ben")*($F11:$F300="return"))
Just enter that formula into cell B2 and hold "Ctrl + Shift" while you hit "Enter." That will create an array formula that will count all instances of "Ben" and "return" for each row. You'll know you did it right if the formula is surrounded by curly braces {}. And, no, you cannot manually add them. You must use the entry combination: Ctrl + Shift + Enter.
If it's the latter, then this should do it:
=IF(AND($A11="Ben", $F11="return"),$E11,"")
You could do this more efficiently with an array formula (as specified above), but it's a bit more complicated and I don't want to confuse you since you're an admitted "novice."
Just enter that formula into cell B11 and then drag and copy it down to the remaining 299 rows. This will return the value of E11:E300 in B11:B300 as you requested in your question.
If it's something other than that, then you need to rephrase your question.

Related

Lookup using multiple columns

I have a sheet filled with data below (and in the image):
Now there's this other sheet where the user will only be inputting the column "Gender" and "Age" values and the excel formula should be fetching the associated factor. Please help me with one such formula.
For e.g. If the user puts Male and 23, the formula should return 3. say Male was entered in Cell D46 and 23 was entered in E46 of Sheet named "Sheet4" and the table shown above happens to be in "Sheet1"
Please advise.
Right, now I can visualize what you meant in your other comments in your previous question, it's a rather easy redo of our other formula.
Formula in F3:
=INDEX(C1:C13,MATCH(1,(ROW(C1:C13)>=MATCH(F1,A1:A13,0))*(B1:B13=F2),0))
Entered through CtrlShiftEnter
Notice that these formulas will return a wrong result if, lets say you extend till females age of 29, and you will search for male, it will still return the value for female. It will however not fail when your searchcriteria would be always right.
You could prevent this in this case (because you only really have one criteria and a fixed range with this formula in F3:
=IFERROR(IF(F1="Male",INDEX(C2:C9,MATCH(F2,B2:B9,0)),INDEX(C10:C13,MATCH(F2,B10:B13,0))),"No result")
Just enter normally. What it does is it checks what gender type is chosen and choses it's lookup index accordingly.
Another option would be to use SUMPRODUCT() like so :
=IF(F1="Male",SUMPRODUCT((B2:B9=F2)*(C2:C9)),SUMPRODUCT((B10:B13=F2)*(C10:C13)))
Also, if you are curious what formulas do and want to learn from them, a great way to do so is using the build-in formula evaluate function, that will show you step by step what the formula will calculate.
EDIT
Tried, as per your comment, to break it down for you so you understand what is going on:
For situations like this, I've learned a good trick how to fill in the blank cells:
Select all cells in the column with the "gender" values.
Goto Special, Blanks. (You active cell should be A3)
In the formula bar, type =A2. (I believe that A2 contains the word "Male")
Press Ctrl+ENTER (don't forget the Control key for filling all selected cells)
As a result, A3 will be copied from A2 and contain the word "Male", A4 will be copied from A3 and will now also contain the word "Male", ...
Further: this stops at the first occurence of the word "Female" (this cell is not selected), and for the later cells, the copying happens in the same way as before.
From here, it should be far easier to achieve your goal.

Excel: find the Max of an array with same names

I have searched the Net and tried multiple solution which never worked. You are my last hope.
I have a table like that:
NAMES.......... VALUES
A...........................4
A...........................1
B...........................4
B...........................3
B...........................2
B...........................1
C...........................4
C...........................3
As you can see, the first column has names only where the second one values.
Both Names and Values often repeat them self.
The idea is to TAG the names (first column) with the MIN value taken from the second column.
So the correct result should be:
NAMES.......... VALUES
A...........................1
B...........................1
C...........................3
I am trying to do that through Excel using the INDEX+Match formula where I am trying to add a MIN formula without success:
=MIN(INDEX($D$25:$D$36,MATCH(C25,$C$25:$C$36,0),1))
I have put the MIN everywhere but none seems to work. Which is the correct syntax and if this is not the right solution, which formula might do the job?
Thank you for your time and help
With data in column A and B, in C1 through C3 enter:ABC then in D1 enter the array formula:
=MIN(IF(A$1:A$100=C1,B$1:B$100,""))
and copy down:
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.
If the data never changes, a Pivot Table is easier to implement.
Two non-array alternatives.
With the newer MINIFS function.
=minifs(d:d, c:c, c25)
Using INDEX in its array format but entered as a standard formula,
=min(index((d$25:d$36)+(c$25:c$36<>c25)*1e99, , ))

Searching within a list of strings with anything in another list of strings in Excel

Example Data
I need to find anything in column B within the strings in Column A and output the cell in Column A in Column C.
I know if it is a short list I can do the highlight cell if a text contains x with Conditional Formatting. However, I have a long list of items that I need to check within the strings of another list.
Let me know if anymore detail needs to be provided. Any help is appreciated. Thanks.
Try this Array formula with wildcards:
=IF(ISNUMBER(MATCH(1, IF(ISNUMBER(SEARCH("*"&$B$1:$B$3&"*",A1)),1,0),0)),"Y","N")
It is an array and need to be confirmed with Ctrl-Shift-Enter.
The search area represented in this small example, $B$1:$B$3 when enlarged must be to the exact range of lookups or it will not return correct values.
You can do this with array formula, type the following in cell C1, then press Ctrl + Shift + Enter:
=INDEX(B:B,MATCH(TRUE,FIND(B:B,A1)<>"#VALUE!",0))
Drag it down column C to match number of rows in column A. You can then put a conditional formatting/filter to see what row in A has substring in B.
If you simply want a yes/no result, enter the following into D1:
=IF(COUNTIF(C1:C6,"<>0")>0,"Found","Not Found")

Excel find lower distinct value in list

I'm trying to find in a list the lowest unique value.
I tried to find out a way on google, but nothing seem to work like I want.
What i have :
John;5
Leon;7
Mark;5
Bob;3
Peter;3
Louis:4
Desired result: "4" because it's the lower unique value.
Suppose I add in the original list:
Alex;4
The new result is about to be "7" because it's the new lowest unique value.
my excel sheet :
Assuming your data is setup so that names are in column A and values are in column B so that it looks like this:
In cell D2 (or wherever you want the result), use this array formula (Note that array formulas must be confirmed with CTRLSHIFTENTER and not just ENTER):
=MIN(IF(COUNTIF(B2:B20,B2:B20)=1,B2:B20))
You'll know you've entered it as an array formula correctly because you'll see it surrounded by curly braces {=formula}in the formula bar. Do NOT add the curly braces manually.
You'll also notice that I have extra rows in there than just the used rows. Normally I'd suggest using a dynamic named range, but this works for now. So when you add the new line of Alex; 4, you get this:
And you can see the formula now has the new correct value of 7.
With data in columns A and B, in C1 enter:
=COUNTIF(B:B,B1)
and copy down. Then in another cell enter the array formula:
=MIN(IF(C:C=1,B:B))
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.
To avoid speed problems, make the limits on the ranges as small as possible:
=MIN(IF(C1:C6=1,B1:B6))

Find blank count in a row with most blanks within a 2D array of cells

I want a formula that will look in a 2D array of cells for the row that has the most blank cells in it. Then I want the number of that row's blank cells returned as shown in the picture. The "Title 2" row has the most blanks at 4 as displayed in B8. I would want the formula to take the whole table into considerations, so cells B2:G5
Or this array formula**:
=MAX(MMULT(0+(LEN(B2:G5)=0),TRANSPOSE(COLUMN(B2:G5)^0)))
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
Sometimes it's easier to break things up into two tasks:
A formula in Column H that counts blanks by row. Something like: =COUNTIF(B2:G2, "="&"") which you would drag down through row #5.
Then, just make Cell B8 the maximum of that new column: =MAX(H2:H5).
I'd be curious if there is some type of array formula trick to accomplish this is one formula. Nevertheless, personally, I find separating the logic into smaller, more manageable, formulas easier to maintain.
In H2 enter:
=COUNTBLANK(B2:G2)
and copy down. In B8 enter:
=MAX(H2:H5)
For example:
Several great answers already, but I'll throw this out there:
=MAX(COUNTBLANK(INDIRECT("B"&ROW(2:5)&":"&"G"&ROW(2:5))))
Enter as an array formula: Ctrl+Shift+Enter
This:
"B"&ROW(2:5)&":"&"G"&ROW(2:5)
… returns an array of strings {"B2:G2" , "B3:G3" , "B4:G4" , "B5:G5"}:
That array is fed to the INDIRECT function, which changes it into an array of ranges {B2:G2 , B3:G3 , B4:G4 , B5:G5}.
That new array is fed to the COUNTBLANK function, which (using your example) returns the array of numbers {2 , 4 , 1 , 3}.
That's fed to the MAX function, so the end result is the number 4.
It's a bit convoluted, so I'm wondering if my INDIRECT parameter can be simplified.

Resources