Excel: Referencing a table to another table [duplicate] - excel

This question already has answers here:
Excel subset column to an array using formula
(2 answers)
Closed 5 years ago.
I have a worksheet that looks something like this
Derrick 123456 good credit
warren 325234 bad credit
john 645345 bad credit
martin 123142 bad credit
Jiren 647546 good credit
I am looking for a formula to search column 3 and if it returns bad credit it draws the values to the left of it on a new sheet for all the bad credits. Conditional formatting is it called?
Sorry for being vague, excel is not my cup of tea.
Edit:
Filtering Worked best as the array formula slowed down the workbook significantly, thanks to pnut, don't know why he deleted his responses.

In sheet2 use the following:
For first column in A2:
=IFERROR(INDEX(Sheet1!$A$2:$A$6,SMALL(IF(Sheet1!$C$2:$C$6="bad credit",ROW(Sheet1!$C$2:$C$6),99999),ROW(A1))-1),"")
For the second column in B2:
=IFERROR(INDEX(Sheet1!$B$2:$B$6,SMALL(IF(Sheet1!$C$2:$C$6="bad credit",ROW(Sheet1!$C$2:$C$6),99999),ROW(A1))-1),"")
Array formulas press Ctrl+Shift+Enter at the same time instead of Enter
change the references A2:A6, B2:B6, C2:C6 to correspond to the last row in your Data (starting in 2nd row)
Keep the $ for fixed references
You can drag each formula in its column

Related

Generate words based on cell values [duplicate]

This question already has answers here:
Formula to generate a value according to a range
(2 answers)
Closed 4 years ago.
[enter image description here][1]I haven't used Excel since high school (2004-2005) but I was pretty proficient in writing formulas back then based on static and dynamic cell values. I'm currently trying to make a spreadsheet that can keep up with statistical data based on yes and no inputs (or 1 and 0 if you prefer binary).
In a game, I am managing a business and want to be able to keep track of employees based on their success. Success is a yes/no value. I'd like to have a table on sheet 2 that has the entire success/failure history of the player and on sheet 1 have a brief overview of their history that's listed on sheet 2 (overall success rate, success rate of last 10 inputs, and success rate of last 5 inputs).
I may or may not be able to figure out the formulas for those. If not, I'll be sure to research before asking for help on that. What I can't figure out is how to assign a word value for a given success rate. For example, I'd like J7 to give a value of "Trusted", "Dependable", "Endorsed", or "Warning" based on the value in K7. If the value of K7 is 90%-100% J7 should populated "Trusted". If the value of K7 is 80%-89% J7 should populate "Dependable". If the value of K7 is 70%-79% J7 should populate "Endorsed". If lower than 70% J7 should populate "Warning".
I'm trying to make the spreadsheet easy to use so that when I expand in the game I am able to share the spreadsheet with new branch owners to keep track of players working under them. That's why I would like the spreadsheet to be easy to manage so it doesn't take them long to figure it out and it doesn't take a long time to manage the spreadsheet so it doesn't rob them of game time.
Thanks in advance :)
This can be done using the lookup function as noted by Jeeped or simply using the IF function. Try using the following in you J column next to the first row of data and populate all the way to where the row where your data in K column goes:
= IF(K1<0.7, "Warning", IF(
AND(K1>=0.7, K1<0.8), "Endorsed", IF(
AND(K1>=0.8, K1<0.9), "Dependable", "Trusted")))
Try this in K7,
=LOOKUP(J7, {0,0.7,0.8,0.9}, {"Warning","Endorsed","Dependable","Trusted"})

Using Excel formulas to find a substring in cells when condition is met [duplicate]

This question already has answers here:
Count if two criteria match - EXCEL formula
(2 answers)
Closed 5 years ago.
I want to search for a given sub-string in column D when conditions are met in columns A and B.
A simple countifs as suggested in the question Count if two criteria match - EXCEL formula does not match because I would like the ingredient (Chocolate in my example) to be part of the values and not an exact match like in that question. It is therefore NOT a duplicate question.
Let's say I own a restaurant (I wish :) and I have this:
Column A: the category of a dish
Column B: the price range of the dish
Column C: the name of a dish
Column D: a list of ingredients in that dish
I want to search if any of the main course that is expensive contains chocolate (i.e. putting in a cell the value FALSE, "No" or 0). It could look like something like that
I don't want to do this by using VBA but rather using Excel Formulas.
Really appreciate your help.
Thanks
[NOTE]:
The difference with the suggested related question is to add * in the matched strings. Although a small difference, it is what made me ask the question in the first place.
CountIfS is your friend here
=COUNTIFS(A:A,"Main",B:B,"Expensive",D:D,"*chocolate*")>0
Enter into E2:
=AND(A2="Main",B2="Expensive",IFERROR(SEARCH("Chocolate",D2)>=0,FALSE))
And drag down.

Summing the results of a lookup when the function arguments contain functions

my question is pretty specific, and I haven't been able to find a solution. Here's a sample dataset that illustrates the problem:
First Last Sales Months
Kevin Smith $500 10
Joe Stevens $400 6
Frank Doe $600 4
I am looking for a solution that doesn't involve any computation columns or cells in the final result.
Now lets say I had this list
Kevin Smith
Frank Doe
I want to sum their sales/month in a separate cell.
I've tried:
=SUM(SUMIF(CONCATENATE(First, " ", Last),FullNames,Sales/Month))
Data is stored in rows 1-3 where column A is first name, Column B is last name, Column C is sales, and column D is months. The full names are in A5 and A6.
When I apply the function I have tried both Enter and Ctrl+Shift+Enter
Strangely enough, this formula works:
=SUM(SUMIF(First,FirstNameSubSet,Sales))
When I don't do any array concatenation or division in the formula.
Unfortunately, in my real life problem, I can't use this workaround.
I tried posting a picture, but even though I've been reading the answers on this site for a long time, I've never posted anything so I have no 'reputation.'
Thank you in advance for you help.
It would be a lot simpler if the full name were also in two separate cells. You could use a simple SUMIFS. But for the problem you present, if I understand it, given the following:
First is the named range containing the first names
Last is the named range containing the last names
Sales is the named range containing the Sales amounts
Month is the named range containing the number of months.
Fullnames is the named range containing the full name (combined first and last name)
Then the following array-entered formula (formula entered by holding down ctrl-shift while hitting enter) should produced the sales per month
=SUM(SUMIFS(Sales,First,LEFT(FullNames,FIND(" ",FullNames)-1),Last,MID(FullNames,FIND(" ",FullNames)+1,99)))
/SUM(SUMIFS(Months,First,LEFT(FullNames,FIND(" ",FullNames)-1),Last,MID(FullNames,FIND(" ",FullNames)+1,99)))
If you need the name comparisons to be case insensitive then change FIND to SEARCH in the formula.
Do you want the result to be all in one cell, or in one cell per row? If not, I am unsure why you are adding down a column (A1:A3).
As another note, if you are only avoiding computational cells/columns for appearance, you could put them on a separate sheet that is hidden.
I would've added this as a comment, but don't have enough reputation.

Conditional IF Statement in Excel, Change Other Cells According to Content

I'm trying to make a revision timetable for myself on Excel.
Let's say I'm doing four exams, A to D. Each exam has a certain number of "practice papers" that I have to do. Below is a demonstration table on Excel:
ExamName NoOfPapers
ExamA 4
ExamB 5
ExamC 7
ExamD 1
There is another table, with two columns: MonthDate and the paper I want to practice on that da. So,
May Paper?
1
2
.
.
.
29
I want to make it work so that if I put ExamA in the field under Paper?, it would automatically deduct 1 from the NoOfPapers of ExamA, to make it 3, so I make sure I'm not repeating the paper too many times.
If I only had 17 papers, it would have been easy to do it manually. But unfortunately I have 99 papers to do (exactly 99 :P).
How can I implement this on a cell as an IF statement (or any other possible way) on Microsoft Office Excel?
Thank you! :)
change the title of the column "NoOfPapers" to "OriginalNoOfPapers". Then create a column next to it called "NoOfPapersRemaining".
Assuming the cell with "ExamName" is A1, use the following formula in C2: =B2 - COUNTIF(Z:Z, A2)
(this also assumes that the column called "Paper?" is in column Z... in real life change it to the correct column on your spreadsheet.
I made four columns in row 1, Exam Name, Exam Total, Completed,Remaining. The completed column has the function
=Countif(B:B,A:A)
in roww 2, 3, 4, 5. The remaining columns are
D2="SUM(B2-C2)"
D3="SUM(B3,C3)"
D4="SUM(D4,C4)"
D5="SUM(D5,C5)"
In row 7 I have three columns, Date Complete, Exam Name, Paper. Exam Name must = The exact same as Cell A2:A5. All you would need is to enter the date and the exam name and it will show the total papers done and the remaining.
This can be better but does what I believe you asked. For instance, use of conditional formatting. If there is a deadline, add a column for the date and use conditional formatting to display an approaching deadline. Freeze row 7 to see remaining after entering a lot of dates in cell A8.
Hope this helps. I'm not a pro but like learning more about Excel.

How to get the newest value from a column with conditions

I have a table in Excel which has the columns:
Date
Person Name
Amount (£)
The table is used to record when people pay me money. Typically, I can get more than one person paying me on the same day. Also, the same person will pay me on many days over the course of time.
Records are added to the bottom of the table so the ordering will be on date but no further ordering on name or amount.
Using formulas, is there a way I can retrieve the most recent amount for a specific person?
If this is too complicated or not possible then I can settle for the following work around:
Add a 4th column to the table called "Last". This will display TRUE if it is the last entry for a specific person, FALSE if it is not.
It felt like there should be a fairly straight-forward answer to this but I found it quite a head scratcher so was interested to see an answer.
Having done some googling I came across a solution posted on a dedicated excel site (view here). [NB - look under the header 'Arbitrary Lookups']
Applying it to your example, suppose your data is in A1:C10 and in cell D2 you want to type a name and return the most recent payment in cell D3:
1 Date Name Amt EnterName
2 20 Jul Bob 50 <enter name here>
3 13 Sep Susan 20 = enter formula here (see below)
4 06 Jan Xavier 100
In cell D3 enter the following as an array formula (i.e. type in formula and then press CTRL + SHIFT + ENTER
=INDEX($B$2:$C$10,SMALL(IF(OFFSET($B$2:$C$10,0,0,ROWS($B$2:$C$10),1)=$D$2, ROW(OFFSET($B$2:$C$10,0,0,ROWS($B$2:$C$10),1))-ROW(OFFSET($B$2:$C$10,0,0,1,1) )+1, ROW(OFFSET($B$2:$C$10,ROWS($B$2:$C$10)-1,0,1,1))+1),COUNTIF(OFFSET($B$2:$C$10,0,0,ROWS($B$2:$C$10),1),$D$2)),2)
It would recommend checking out the link I provided if you want more detail. For clarity, I have merely adapted the formula (changed cell references) from the link provided.
Here's one way to do it based on an answer I gave in a previous SO post.
=INDEX($C$1:$C$19,MATCH(MAX(IF($B$1:$B$19="PersonNameHere",$A$1:$A$19,0)),IF($B$1:$B$19="PersonNameHere",$A$1:$A$19,"")))
Where A is the Date column, B is the Person Name column, and C is the Amount column. You must enter this as an array formula by pressing Ctrl+Shift+Enter.
I can't see right here an easy way to do it in only one formula.
If you have your data from A2 to C11.
You can add this formula on the 4th column (let say in cell D2):
{=MAX(IF($B$2:$B$11=B2,$A$2:$A$11,0))}
This is an array formula you have to validate with Ctrl-Shift-Enter
This will tell you what is the last date for the current person.
And then find the last amount with another column (let say in cell E2) and use this formula:
=INDEX($C$2:$C$11,MATCH(D2,$A$2:$A$11,0))
[EDIT] I've just tried to combine the formulas into one and that simply works:
{=INDEX($C$2:$C$11,MATCH(MAX(IF($B$2:$B$11=B2,$A$2:$A$11,0)),$A$2:$A$11,0))}
and this is still an array formula.
Alas, #Excellll was smarter (and faster) and gave the solution at first shot

Resources