I am designing a Material Resource Plan using Excel. I have a two week lead on parts with lot sizes of 90. To auto fill the fields, I would like to be able to input '2' and have Excel recognize that if cell E30 (Planned Order Receipt) has a value, that C31 (Planned Order Release) should display the lot size (as in two weeks prior an order should be placed). Is this type of function possible?
Try
=IF(NOT(INDEX(ISBLANK($D$30:F30),B23)),B24,"")
where $D$30:F30 represents the value of Planned Order Receipt from Week 2 to Week 4. If you have more than 4 weeks, replace F30 with the actual ending cell of this range (and suggest to use absolute cell reference i.e. putting a dollar sign $ in front both column and row ID).
ISBLANK function will check each cell in the range $D$30:F30 is blank (not returned by a formula but a real blank cell), and return a range of TRUE or FALSE.
INDEX function will return the corresponding TRUE or FALSE based on the lead number you entered. If you enter 2, INDEX will return the second value from the range, so on so forth.
NOT function will reverse FALSE to TRUE i.e. TRUE for a non-blank cell. Then IF function will return the lot number as desired, but return a blank "" if that's not the case. You did not specify what you would like to return if the Planned Order Receipt is blank so I just used blank "".
I did some searching today and ask Dr. Google a little differently. I was able to locate this solution using the Offset function:
=OFFSET(C26,4,$B$23,1,1)
Related
This one is interesting and I am not even sure if it can be done with a formula. I can do it with a macro but I want a formula for this one.
I have 2 sets of data. The 1st set contains some dates and a true/false field and an ID number. The 2nd set of data contains some dates and ID number and a blank column. Now I need to find the 1st occurrence of an ID number in the 2nd dataset and then based on that check the 1st dataset for matching numbers and then check if value is false in the 3rd column. If that value is false return date from 2nd column.
Now I can go this on my own with a vlookup if I only wanted the 1st occurrence but I need to get all matches. The dates in the 2nd column can be ignored they are not part of the formula.
Here is an example of what the data should look like after applying the formula. I need the false dates to be returned. I know I can build this as a function but I really need to do a formula if possible.
Update:
I did find JOINTEXT() however that does not work in excel 2013 :| so that is out of the question.
You can use INDEX and AGGREGATE combination:
=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW(A:A)/((G2=A:A)*(0=--(C:C))),COUNTIF($G$2:G2,G2))),"")
In my example in column C are boolean values. If you have text there then change part of formula (0=--(C:C)) to ("FALSE"=C:C)
I know how to use index and match formulas to get the value or location of a matching cell. But what I don't know how to do is get that information when the cell I'm looking for isn't going to be the first match.
Take the image below for example. I want to get the location of the cell that says "Successful Deliveries". In this example there's a cell that matches that in rows 11 and 30. These locations can vary in the future so I need a formula that's smart enough to handle that.
How would I get the location of the second instance of "Successful Deliveries"? I figured I could use the "Combination 2 Stats" value from row 24 as a starting point.
I tried using this formula:
=MATCH("Successful Deliveries:",A24:A1000,0)
But it returns a row number of 7 which is just relative to the A24 cell I started my match at.
My end goal here is to get the value from the cell directly to the right of the second match of "Successful Deliveries".
In your formula, with no further intelligence, you can simply add 23 to adjust 7 to the result:
=MATCH("Successful Deliveries:",A24:A1000,0) + 23
You know that 23 is the number to add because you started your search on row 24.
The full answer is here:
https://exceljet.net/formula/get-nth-match-with-index-match
You use this formula:
=INDEX(B1:B100,SMALL(if(A1:A100 = "Successful Deliveries:",ROW(A1:A100) - ROW(INDEX(A1:A100,1,1))+1),2))
...where 2 is the instance you want.
Make sure to finish typing the formula by hitting ctrl-shift-enter. (You know you did this right because the formula gets curly brackets {})
HOW IT WORKS
Normally, we use INDEX / MATCH to find a value. The Index function gives you the nth value in a range, and the Match function determines which "n" is a match for our criteria.
Here we use INDEX the same way, but we need more intelligence to find that "n", since it's the second one that matches the criteria. That's where SMALL comes in. The Small function "gets the nth smallest value in an array". So we give Small the number of the desired instance (2 in this case) and we give it an array of blanks and the rows numbers of the rows we like.
We obtained the array of blanks and row numbers using the If function, asking it to check for our criterion (="Successful...") and making it return the row number where the criterion passes (=Row(A1:A100)). By using the If function as an array function (by giving it arrays and using ctrl-shift-enter) it can deliver a whole list of values.
Our final value is just one number because the Small function used the array from the IF to return just one thing: the second-smallest row we gave to it.
I am trying to get some code working but when I change a target cell into a range of cells I get an error #VALUE!
this code works
=IF(AND(A1=Sheet2!A2,B1=Sheet2!B2),"TRUE","FALSE")
but if I add a range I get #VALUE! Error
=IF(AND(A1=Sheet2!A2:A10,B1=Sheet2!B2:B10),"TRUE","FALSE")
Update : Here is an example of what I am trying to achieve
Any help would be much appreciated
Many Thanks,
And
Different approach from your logic statement. Instead it looks through your table and match the name with the row and the column with the date selected and the pulls the value at that location.
=INDEX($B$7:$G$8,MATCH($B3,$A$7:$A$8,0),MATCH(C$1,$B$6:$G$6,0))
IMPORTANT: The names in you B3:B4 area have to be unique and spelled identical to your A7:A8 area. That included trailing or leading spaces that you may accidentally drop in.
Adjust reference ranges to match your need if tables are on different sheets of your workbook.
THIS IS AN ARRAY FORMULA - Hit Ctrl+Shift+Enter While still in the formula bar
=INDEX(B2:B10,SMALL(IF(A2:A10=A1,IF(B2:B10="ONCALL",ROW(A2:A10)-1)),1))
=INDEX(B2:B10, - Look through B2:B10 and return the row number calulcaulated by:
SMALL(IF(A2:A10=A1,
IF(B2:B10="ONCALL",
ROW(A2:A10)-1)),1))
This is building an array of row numbers minus 1 where both IF statements are true (Date matches and "ONCALL" present), SMALL then returns the nth value in ascending order - I have asked for the 1st match (or the smallest row number) which INDEX then uses to return the result.
I have the following formula to return the value of the last value in a column:
=LOOKUP(2,1/(D:D<>""),D:D)
What I need now is to return the value of the cell adjacent to it as well. (It will not necessarily be the last value in that column and the info in Column D could have duplicates.
If your data looks like this:
A 1
A 2
A 3
B 4
B 5
B 6
C 7
To get last value this will do the trick:
=INDIRECT("B"&COUNTA(A:A))
And to get last where value is A:
=INDIRECT("B"&MATCH("A",A1:A7,0)+COUNTIF(A1:A7,"A")-1)
Just use next column:
=LOOKUP(2,1/(D:D<>""),E:E)
Ok, So I have found an answer by playing around with array formulas.
The problem was that this is a stock control sheet where there are changes made at multiple times, each recorded in the next available row. There is always a date (Column E) but not necessarily a Supplier, as it might be stock moving out. When a Supplier delivers, the Supplier name is recorded in Column D. In D1 the last supplier is then shown with the following formula.
=LOOKUP(2,1/(D:D<>""),D:D)
I want to then see what date it was last received. The formula I found that works is as follows (Array Formula):
=INDEX(E:E,MAX(IF(D:D=D1,ROW(D:D)-ROW(INDEX(D:D,1,1))+1)))
This is generally how I do it:
=XMATCH(FALSE,ISBLANK(A:A),0,-1)
This is what each part does:
Parameter
Explanation
FALSE
Instructs Excel to find the first instance of FALSE that it finds
ISBLANK(A:A)
Takes in the column A:A and notionally assigns a value to every item in the column
0
Means we want an exact match. Probably not necessary to put in, but I think it's good practice anyway
-1
Instructs Excel to start the search at the bottom/right of the range and work up/left. If you change this to 1 (the default), Excel will begin the search at the top/left and work down/right
So, taken together, this will search from the bottom of the column A:A, until Excel finds the first cell that is not blank, and return that cell.
Also, yes, this equation can be changed to a row format (e.g. 1:1), and can take a smaller range (e.g. A1:A20), but it cannot take a 2-dimensional range (e.g. A1:B20).
As a practical matter, this approach is much faster than other approaches (and much faster than you'd think, given it's evaluating against every row/column in the range), and won't get fooled by columns that have empty spaces in them (like with a COUNTA style approach).
I want to sum all values of one row (there are a lot of column) if there is a specific value in the first column.
Below follow the problem:
Link with the image
I want to find API Rheology and then find Cond. Time, with verified this two conditions, sum all values of the row.
You need to check the value of the first column with an "IF" function, and then if it's true, use "SUM" to find the total.
For example, if your first column is in a1, and your data goes from a1 to z1, than your formula should look like this:
=IF(A1="[check value]",SUM(A1:Z1),"")
Where you replace [check value] with what value you are looking for and "" with what you want to display if the value is not there. Putting "" will leave the cell blank.
If you want to be more specific and check if the first column contains a value, then you need to use:
=IF(ISNUMBER(SEARCH("[check value]",A1)),SUM(A1:Z1),"")
With the same arguments as before.
If you want to find multiple values than you need to use the AND function, so your function becomes:
=IF(AND(ISNUMBER(SEARCH("[check value]",A1)),ISNUMBER(SEARCH("[check value 2]",A1))),SUM(A1:Z1),"")
This will check if cell A1 contains both strings. If you want to check two different cells, then just replace the second A1 with whatever other cell you want.
If you want to find the string within a column of cells, replace the "A1"s with the list of cells you are looking for the string in. e.g. A1:Z1
The reason this works is because SEARCH returns a number based on where the [check value] is found within cell A1, or an error if the string doesn't appear. ISNUMBER returns TRUE if SEARCH return a number, not an error. Finally, IF checks if ISNUMBER is true or false, and returns the sum of your numbers if true and a blank space if not.
Hope this helped.
The sample data image seemed incomplete so I added a few things.
The formula in AE65 is,
This formula looks down column A for the name of the test (e.g. API Rheology in AC65) then locates the next occurrence of the reported result section (e.g. Cond Time (min) from AD65). Having located that row, it sums columns C:Z.