Match value based on criteria in two columns - excel

I have the following values in columns A, B and C.
A B C D
3 3 5
4 4 10
In cell D1, how can I find the value in Column C where A=A+1 and B=B+1 i.e. 10?

Are you looking for something like below?
=VLOOKUP(SUM(A1+1,B1+1),C:C,1,FALSE)

Related

Excel Data convert from single row to multiple row

I have data in excel in following manner.
Colname Count
A 5
B 3
C 4
I want to convert it into this way.
A 1
A 2
A 3
A 4
A 5
B 1
B 2
B 3
C 1
C 2
C 3
C 4
Based on the count i want that data must be converted into rows with increasing order. Please let me know the feasiblity .
=IF(ROW()<B$1+1,"A",IF(AND(ROW()>B$1,ROW()<SUM(B$1:B$2)+1),"B",IF(AND(ROW()>SUM(B$1:B$2),ROW()<SUM(B$1:B$3)+1),"C",""))) in F1 and fill down. In G1, this formula =IF(COUNTA(F1)>0,COUNTIF(F$1:F1,F1),"") and fill down. Letters are in Column A and numbers in Column B. I chose these columns randomly to work a solution. Change to match your actual data, if needed.

VLOOKUP issue in Excel

I have the following basic VLOOKUP setup, having not used Excel in anger for a while. I am looking up the values a, b and C in a table containing two columns.
<value returned> <expected>
a 1 b =VLOOKUP(A1,C$1:D$1,1,FALSE) #N/A #N/A
b 2 c =VLOOKUP(A2,C$2:D$2,1,FALSE) #N/A 2
c 3 d =VLOOKUP(A3,C$3:D$3,1,FALSE) #N/A 3
I am getting #N/A returned for all rows (as shown to the right), but I would expect the values to the right again to be returned. Can someone please explain what I have done wrong?
Thanks
If you still stick to dataset :
a 1 b
b 2 c
c 3 d
then : =INDEX($C$2:$C$4,MATCH(A1,$D$1:$D$3,0))
So if you re-arrange the data as :
a 2 b
b 3 c
c 4 d
then use : =INDEX($C$1:$C$3,MATCH(A1,$D$1:$D$3,0))
hope that helps. (:
When using VLOOKUP, the column containing the key to be matched has to be the first column on the left of the range. So change your data layout to this:
A B C D
a b 1
b c 2
c d 3
and use the following formula:
=VLOOKUP(A1, C$1:D$3, 2, FALSE)
and then it should work. As #Scott mentioned in his comment, if you want to keep your data layout the same, you could look into using INDEX.

How to count unique values w.r.t one column in excel?

I am trying to find the number of unique values in column B("Levels") for each value in column A("Heads").
For example for Heads "A" we have 3 unique values ("ALPHA", "BETA", "ECHO") and it should return in column "Expected Count".
Heads Levels Expected Count
A ALPHA 3
A ALPHA 3
A BETA 3
A ECHO 3
B CHARLIE 2
B CHARLIE 2
B DELTA 2
C ALPHA 4
C BETA 4
C CHARLIE 4
C DELTA 4
I need to execute the functionality for 1000's of rows. Is there any formula?
you need one new column. insert it between B and C. concatenate column a and b with formula
=a&b
then do a simple formula in column d and drag that down on your 1000's of rows
=countifs(C:C,C2)

SUMIFs in Google sheets with 2 filters on same criteria range

I have looked at various answers but all use filters on different columns. I need an OR type filter like this:
=SUMIFs(B2:B22,C2:C22,"Incurred",C2:C22,"Expected")
Where C2:C22 specifies if the cell in B is an incurred or expected or deferred expense.
How do I do this? Note the filters are on the same set of cells in column C.
This is the data in A6:C6:
1 A C
2 B D
3 A D
4 B C
5 A D
6 B D
To sum the values if column B is A or column C is D you can use:
=SUM(ARRAYFORMULA((IF(((B1:B6="A")+(C1:C6="D"))>0,A1:A6))))
This uses the fact that True equals 1 and False equals 0 once you want to use them in equation.
You may try this...
=SUMPRODUCT(((C2:C22="Incurred")+(C2:C22="Expected")+(C2:C22="Deferred"))*B2:B22)

How to match columns and adding blank rows in excel

I have an excel file with 5 rows in column A and B, and 3 in column C and D (in reality though, I have a couple of hundreds of rows). Column B consists of text belonging to A, and D of text belonging to C. Column C has some of the values found in column A.
It looks like this:
A B C D
1 1 stringA1 1 stringC1
2 2 stringA2 2 stringC2
3 3 stringA3 4 stringC3
4 4 stringA4
5 5 stringA5
Now, I would like to match the numbers in column C with those in A, so that matches are put in the same row. For those rows in A for which there is no match in C, I want to have blank cells after column B.
It would look like this in this case:
A B C D
1 1 stringA1 1 stringC1
2 2 stringA2 2 stringC2
3 3 stringA3
4 4 stringA4 4 stringC3
5 5 stringA5
I have some idea that I should use VLOOKUP and maybe Conditional Formatting, but unfortunately I am not very experienced in excel. Could someone please suggest a way to do this?
Enter the following formula in Cell E1:
=IF(IFERROR(MATCH(A1,$C$1:$C$5,),"")<>"",INDEX($C$1:$D$5,IFERROR(MATCH(A1,$C$1:$C$5,),""),1),"")
and this one in Cell F1:
=IF(IFERROR(MATCH(A1,$C$1:$C$5,),"")<>"",INDEX($C$1:$D$5,IFERROR(MATCH(A1,$C$1:$C$5,),""),2),"")
Using Helper Column:
You can also do this using a helper column.
In Cell E1 write:
=IFERROR(MATCH(A1,$C$1:$C$5,),"")
Then in Cell F1 write:
=IF(E1<>"",INDEX($C$1:$D$5,E1,1),"")
And finally in Cell G1 write:
=IF(F1<>"",INDEX($C$1:$D$5,E1,2),"")
This was answered by #user3514930 to a question here.
You can directly use this formula in D2 and copy downwards:
=IF(A2 = C2, A2, "")
Now if you have formulas in A2, C2, type in those formulas in place of A2, C2 in the above.

Resources