Two formulas I'm having issues with - excel

this is my first time asking a question here, but I have two formulas that I'm not really sure why they aren't working.
The first issue I'm having is with this formula:
=MAX(IF(C46:C51<80,B46:B51))
Any reason that this formula returns #VALUE! I'm supposed to find the max value of data in column B so long as the data in column C is less than 80.
Then I'm having issues with VLOOKUP on two questions, that are related I have a large dataset on a separate worksheet. I need to VLOOKUP someone's name to find a value associated with that name. The problem is that their name comes up multiple times. The formula I have for it so far is:
=VLOOKUP('PDR DATA'!E80,'PDR DATA'!A4:V119,15,FALSE)
Where 'PDR DATA'!E80 is the first instance of the person's name appearing. However, using FALSE with VLOOKUP returns #N/A, but if I use TRUE it returns the very last value from column 15 even though the name is different from what I'm searching for. I'm lost here and don't know where to turn.

=MAX(IF(C46:C51<80,B46:B51,C46:C51)) works for me. (Please ensure B46:B51 & C46:C51 has integer values)
=VLOOKUP(cell you want to lookup for, cells where you want to lookup(maybe more than one column), which column you want to fetch from (number), rangelookup) try to understand the syntax and give your inputs
ex: If I have a existing data with Name and id in sheet2, need that id in sheet1 by using the name then I will use =VLOOKUP(L2,Sheet2!A2:B5,2,TRUE)
L2 is the sheet1 name, then I have selected both columns(A,B) and rows in sheet2, then column number is 2.

Related

Find value in the same row of another value that has been looked up?

I looked up values from another sheet with the following formula:
=IFERROR(INDEX('Detail list'!$H$2:$H$1604;SMALL(IF(1=((--(A$1='Detail list'!$J$2:$J$1604))*(--(A$2='Detail list'!$I$2:$I$1604)));ROW('Detail list'!$H$2:$H$1604)-1;"");ROW()-2));"")
This lookup is based on two criteria: Company name and year.
The lookup happens in cell A3 and onwards. It uses the company name in A1 and the year from A2 and then finds a corresponding value in another sheet. There's duplicates involved here since the column that is used for this look up consists only of 001 up til 010. It still is able to return all the values in the correct sequence based on year and company name.
I now want to look up or couple a 'corresponding' value with the value that was just acquired. For example: The value in A3 (005) refers to a specific cell in the other sheet. I want to return a value from that exact row but a different column. I have tried the following:
=IFERROR(#INDEX('Detail list'!$B$2:$B$1604;AGGREGATE(15;6;(ROW('Detail list'!$H$2:$H$19883)-ROW('Detail list'!$H$1))/('Detail list'!$H$2:$H$19883=A3);COUNTIF($A$3:$A3;A3)));"")
This does return a value (namely a client value) but this it is not precise as it takes the first 005 it comes across in the full list (so no longer sorted on year and company!) and reports that. I need it to be from the exact row the previous value is referring to.
I'd be so happy if anyone could help me out with this one. If not, I understand completely,
Kind regards,
VHes
Keeping references consistent and clear across sheets while nesting statements can be tricky. Have you considered pasting the data from 'Detail List' into your current sheet and using something like VLOOKUP or INDEX that way?
Another possible solution would be to throw everything into a pivot table and use the filters to get what you need. Not sure if either of these apply to your task.

Assign a value to a variable [Excel]

I'm making a basic inventory list for my place of work and want to make it easier for future inputs and changes. So far I have inputted all of the model numbers for our inventory, and I was wondering how I could assign a price to the model number, so that it automatically fills it into the cell two cells right. I'm also working with around 50 model numbers, so it would be a lengthy function.
Example:
B E
778740 125.99
778739 120.99
778740
Is there a way that the second "778740" could be automatically filled in? I'm fairly new to excel and I can't find this problem, although I know it is very simple and exists. Even if some one could link me it that would be very much appreciated. Thank you!
Suppose your headers are in row 1, model numbers in column A and prices in column B. You could use the following formula in cell B3 and drag it on down as far as you need. Then what you fill in in column A matches something above, the cell next to it will automatically populate. And otherwise it stays blank, letting you know it is on you to fill it in (though once you do, the formula will no longer be there, so if you later fill in a match above, the magic is gone).
=iferror(indirect("B" & (1+match(A3,A$2:A2,0))),"")
The match function returns an error if nothing is found, and ifError will handle that by leaving your cell blank. If a match is found, we get the value from the corresponding row in column B.

How to tell if a cell exists on another Google Sheet

I have 12 sheets in one Google Sheets document labeled for each month (January - December). On each sheet column A contains a project number, e.g. "6091".
I'm trying to find a function that will check all of the other sheets to see if there are duplicate cells in the "project number" column of other sheets.
So: "Do any of the cells in column A, match any of the cells in column A on other sheets".
Is there a quick way to do this?
The formula =arrayformula(iferror(match(A2:A, AnotherSheet!A2:A, 0))) checks each value in A2:A of the present sheet for being in A2:A of AnotherSheet. If it's there, it returns the position in AnotherSheet, otherwise the output is empty (the error #N/A is suppressed by iferror).
You can use the above for each of the sheets separately. Alternatively, if you are not interested in the positions and just want to know which entries from A2:A are found elsewhere, then add the results for each sheet:
=arrayformula(iferror(match(A2:A, AnotherSheet!A2:A, 0)) + iferror(match(A2:A, ThirdSheet!A2:A, 0)))
The output is 0 is there is no match, and a nonzero number if there is.
You may try using this to find the number of duplicates:
=counta('JAN'!A:A,'FEB'!A:A)-countA(unique({'JAN'!A:A;'FEB'!A:A})
Where A:A is your column for the data you want to check and the respective files.
This formula counts the total number of data you have, minus the unique data, therefore giving you the total number of duplicates in your dataset.
This formula gives you an overview of the total number of duplicates, however, it doesn't show which cell is a duplicate.
Alternatively, you can add a checker column and input the following formula to check if that specific cell is a duplicate.
=match(cell to check,{range 1;range 2;...range 12})
Alternatively, you may use this formula to find the exact duplicates between the ranges, however this formula does not search within the range itself for duplicates.
=arrayformula(filter(range to check,(countif(arrayformula({Range 1;range 2}),{range to check}))>1))
Personally I think that the last option would be the best as it gives you the exact data to correct.
I am still new to this so hope this helps:)
This formula should work for numerical values:
=COUNT(QUERY({March!A:A;April!A:A},"where Col1="&A2))
If you are searching for text values it would be
=COUNTA(QUERY({March!A:A;April!A:A},"where Col1='"&A2&"'"))
Unfortunately the QUERY function does not work within an arrayformula so you would need to copy the formula down the column. You can add in extra sheets into the { } array as required, separated by a semi-colon
Edit: actually, borrowing from #sandwich, this version should work without the need to copy the formula down the column:
=arrayformula(iferror(match(A2:A,{March!A:A;April!A:A},0)))

Excel: Vlookup in named range and return a value outside of range

I need to find a way to search for a value in a named range and to return the column next to that range. The reason is simple: I do use list validation with a named range in column A. In this list there are complete name of product types (ex. Relay, Contactor, Enclosure) and I need to return a short description from column B (ex. Rly, Cont, Encl) so that when the user searches the list it's easy to find what he is looking for. I know I could extend my range to $A:$B but if I do then all the values of $B will be included in the list...
This shows a way to figure out what I need: =VLOOKUP(A1;"RANGE+1C",2,0)
I tried so many ways with offset and index but couldn't find a way to do so... I even thought it would be possible of doing it with relative reference (ex. =VLOOKUP(A1,Description;1"RC[1]",0) or something like that...
Also looked in Google to find some info but it seems to be something very unfamiliar...
I need to do this in a formula and not in VBA.
Here is the link to an example file:
http://www.filedropper.com/descriptionbuilder
Any hint?
Thank you!
What you probably want instead of VLOOKUP is the MATCH & INDEX combo.
MATCH is a function which tells you the row number where a duplicate value is found from your selected list - it's like half of VLOOKUP. INDEX is a function which pulls a value out of a list, based on its position # that you give it - it's like the other half of VLOOKUP.
I see your one Range in column A with your ID data is Description - I'll assume that column B has no 'named' range that aligns with yours. I'll assume that column B has other data, and that column A starts somewhere after row one [specifically, I'll assume it starts at row 5]. Together the formula would look like this:
=INDEX(B:B,ROW(A5)-1+MATCH(A1,Description,0))
This says: find the row # within Description that matches the text in A1. Then add the row # of A5 - 1 (this then alignts the top of Description with the top of column B). Then pull that value from column B.
Alternative Method using VLOOKUP and OFFSET
Another method would be to first define how many rows are in Description, and then using that information and the OFFSET function, create a new area which essentially represents Description but going across column A & B instead of just column A. This would look as follows (again, assuming Description starts at A5):
=VLOOKUP(A1,OFFSET(A5,0,0,ROWS(Description),2),2,0)
This says: count how many rows are in Description. Build an array with OFFSET which starts at A5, with as many rows as there are in Description, and 2 columns. (So with 3 items in Description, this would be A5:B7). Then use that new Range in VLOOKUP, and try to find A1 the Description area in column A, and return the result from that row in column B.
You can use Offset to expand a named range by one column and then feed it into Vlookup Something like:
=VLOOKUP(C1,OFFSET(RANGE,0,0,,1+COLUMNS(RANGE)),1+COLUMNS(RANGE))
To test is, I created a named range (called "RANGE") in Column A, I placed values in Column B adjacent to the named range, put a lookup value in C1 and the entered the above formula. It succeeds in retrieving the desired value.
On edit: I think that Grade'Eh'Bacon's answer is excellent and is probably the best approach to this specific problem, but it strikes me as potentially useful to know how to expand the reference of a named range without changing the name itself, so I am keeping this answer.

Two Column Lookup

I have a data set that I want to return an indexed column using two values: a year and a name. Both these values are formatted to general (I also tried text) in my spreadsheet.
In one work sheet I have a like of people:
On the other, I have a table of Years, Names, and a number
I am trying to do a lookup on the joined year and name and return the given number in the second table. For instance 2013Andrew McCutchen would return 8.2, and 2014Andrew McCutchen would return 6.8.
Currently, I only get the #N/a value with the following"
=INDEX('2006 Results'!C2:C556,MATCH($J$1&C3,'2006 Results'!$A$2&$B$556,0))
But, I know a certain value is in the table though because I have tested with an if statement to make sure my spelling is correct. Any guidance would be much appreciated.
I would add a column to the left of the year column as column A to contain the following formula in cell A2 which refers to the year and name column:
=$B2&$C2
You can then use this column in a VLOOKUP formula on the people sheet. Cell J3 would read as follows. Copy this to all cells in the table body.
=VLOOKUP(J$1&$C3,'TheYearSheet'!$A$1:$D$556,4,false)
Job done.
In your match expression, you are comparing one concatenated value $J$1&C3 to another single concatenated value '2006 Results'!$A$2&$B$556. Match expects that second parameter to be a range rather than a single value.
In cases like this, where multiple criteria are required, I prefer to use sumifs rather than index-match, even though the intention is to return a single value. I think =SUMIFS('2006 Results'!$C:$C,'2006 Results'!$A:$A,j$1,'2006 Results'!$B:$B,$c3) will give what you need and should correctly copy to the other cells in that table.

Resources