Using If Statement in Excel - excel-formula

I want to copy a cell from a worksheet based on Unique number.
If Unique number from L is equal to NO2 column, Then I want to copy block column next to the L column.

As you're looking left from your lookup you can't use a VLOOKUP - you need to use INDEX & MATCH....
Match the figure in column L with the figure in column J.
MATCH(L2,Sheet2!$J:$J,0)
Return the figure from column K in the row returned by the Match.
=INDEX(Sheet2!$K:$K,<row number>)
=INDEX(Sheet2!$I:$I,MATCH(L2,Sheet2!$K:$K,0))
Scratch that... why have you put the columns the wrong way around?
Just use a VLOOKUP: =VLOOKUP(L2,Sheet2!$J$2:$K$11,2,FALSE)

Related

Need assistance me with this Excel Task? Unable to generate the proper results

Looking for help with this task. Here's is a portion of the table I'm working with:
What I'm trying to do is have the cells in Column B (MWD) return the value of the adjacent cells in Column C (Pseudo). Column A (Data Set) has the same values as Colum B but including duplicates. I need a formula where the duplicates in Column A will return the same value that it matches in column B.
Example: I need...
all the duplicate 1010001's to return pseudo 1
all the duplicate 1020001's to return pseudo 2
all the duplicate 1020002's to return pseudo 3
and so on...
I was trying to use index match function but don't know if I'm constructing the formula wrong or if it's the correct formula to use.
If data is sorted by column A, you can use one formula:
=IF(COUNTIF($A$1:A2,A2)>1,C1,C1+1)
if not, then other
=IF(COUNTIF($A$1:A2,A2)>1,INDEX($C$1:C2,MATCH(A2,$A$1:A2,0)),MAX($C$1:C1)+1)
in both cases copy the formula in second row (in C2 cell in my examples). To the first row add 1 manually.
First example:
Second example:

How to lookup a value from another column and display Row number?

I'm setting up an excel file for the operators. They will scan the Barcode from the product and it will populate in one of the column of the excel sheet.
I have tried using LOOKUP formula in excel but it doesn't seem to be working right.
COL A : Data from Database
COL B : Data from Scanner
COL C: Row number
Find the value of Column B in Col A and populate the Row no. in Column C.
=LOOKUP(B5,A:A,ROW(A:A))
I have used this formula in every cell of the column C.
The row number don't populate accurately.
=MATCH(B5,A:A,0) should give you the rownumber. And if you wish to obtain the cell's address: =ADDRESS(MATCH(B5,A:A,0),1,4,1)
If you are using combined cells then you definiately want to use absolute ranges like =MATCH(B5,$A$5:$A$10,0)
Search B column in A column and get row back. You could use:
Note:
Do not forget to use IFNA in case of B does not included in A.
In my opinion there is no need to target whole range.
=IFNA(MATCH(B1,$A$1:$A$6,0)+ROW($A$1:$A$6)-1,"")
Results:

Retrieve a cell text based on a number from different column in excel/google sheets

So, I have some sort of a score table: In column A are listed the names of contestants and through column B to I there are the partial scores; and column J has the total score. Then, in a random cell in column L I've used MAXfunction to retrieve the highest score from my table; but, where I am stuck is that I am trying to figure out a way where, using a function, the cell next to L automatically returns the name of the contestant with the highest score (the score in cell L).
I have tried with VLOOKUP function, but I can't get it right, because column A is text and not a value.
Thanks for the help
Use index and match. Put this in column L:
=index(A2:A,match(max(J2:J),J2:J,0))

Sum-if function: the value from one column and have the function sum the cells x places to the right/left of the original column

I would like help trying to figure out how to sumif a value from one column and then sum all the values to the left of the column.
For example, if column B has a value of 1 then sum all the cells one space to the left of column B that have a 1 in column B.
I tried using VLookup or index/match but could not get the formulas to work. I have attached an image below which might make it clearer.
Try this. -1 in the OFFSET is for 1 column to the left.
=SUMPRODUCT((B2:B18=1)*OFFSET(B2:B18,0,-1))
=SUMIF(B2:B14,1,A2:A14)
So the breakdown of this formula is: SUMIF(range,criteria,[sum range]). The first range, is the range that you will check against the criteria that you set (if you wanted to have a cell to change what you are summing, replace 1 with that cell instead) the [sum range] is simply the range that you want to be added up but this will only add the rows where the range,criteria are true.

Is vlookup the correct thing to do to have the results next row

I'm using a vlookup to look for the all cells in the column D and see if they got a positive match in the C cells. If yes, I'm putting what is in the B cell next to the C cell.
In the example below, E2 will have what is inside of B2 after a lookup on D2 in the C column.
I've tried this formula but it is not the good one
=VLOOKUP(D2,C:C,0,FALSE)
I hope I don't need VBA
Best.
It is not completely clear exactly what you are looking for. I think you are trying to lookup data in column B based on a key in column C. If so what you want to use is
=INDEX(B:B,MATCH(D2,C:C,0))
As a breakdown, the MATCH will return a number representing which row within the range C:C matches the key D2. And, INDEX returns the element in B:B at row MATCH(D2,C:C,0).

Resources