Excel question on addition with integers and string values - excel

I need to fill in the cells below ROW1 with adding 2 onto the last number. Example below:
ColA ColB ColC
ROW1 G385 G384 G288
ROW2
ROW3
Desired result
ColA ColB ColC
ROW1 G385 G384 G288
ROW2 G387 G386 G290
ROW3 G389 G388 G292
Right now if I drag and drop the cells in row1, the results will increase by 1, I need them to increase by 2.
Any ideas?

The formula I think you're looking for is:
= "G" & Value( right( B2, len(B2)-1)) + 2
This takes "G" and adds it to the beginning of the solution. The math take the value of all the characters right of the G and adds 2.

Related

Excel: search value in array and fetch row and column name

I have a spreadsheet of available samples across 45 boxes, arranged stacked with column headers from 1 to 10 and row headers from A to J. I'm looking for a way to fetch the box, row and cell number if I lookup an ID (prefixed with B).
Sheet 1 is a list of animal IDs that I want to know if a sample is available for
Sheet 2:
Box 1
1 2 3 4 5 ... 10
A B43 B12 B3 B6 B103
B B13 B14 B78 B51 B63
C B78 B33 B99 B43 B92
...
J
Box 2
1 2 3 4 5 ... 10
A B2 B6
I have tried doing nested if functions by columns:
if(match(A2, Sheet2!$B$2:$B$521,0),"1",if(match(A2,Sheet2!$C$2:$C$521,0),"2","")
...but I've been getting #N/A if A2 is in column C.
I've resorted to re-labelling the left-most column to Box 1 A, Box 1 B, Box 1 C... so on, and doing:
=index(Sheet2!$A$2:$A$521,match(A2,Sheet2!$B$2:$B$521,0),0)
...and duplicating the function for **Columns 1 to 10*.
Sheet 1:
Animal ID Col1 Col2 Col3 Col4 ...
B12 . Box 1 A . .
B43 . . . Box 1 C
...
Is there an easier way to fetch the location of a sample from an array?
If your Sheet2 looks like this.
and you want the data like this in Sheet1.
Then enter this formula in Cell B2 of Sheet1 and drag it down and across.
=IFERROR(CONCATENATE(INDEX(Sheet2!$A:$A,(MATCH($A2,Sheet2!B:B,0))-MOD(MATCH($A2,Sheet2!B:B,0)-1,12),)," - ",INDEX(Sheet2!$A:$A,MATCH($A2,Sheet2!B:B,0))),".")

excel multiple column vlookup

My table
Id index Col1 col2 col3
a 1 smith
a 2 John
b 1 mark
b 2 kay
b 3 Van
c 1 Par
c 2 Cap
In the Vlookup Table
ID Col1 Col2 Col3
a Smith John
b Mark kay Van
c Par Cap
How do I achieve by doing vlookup by id
I believe this will solve your issue:
This is the formula in cell I2:
=INDEX($C:$C,MATCH($H2,$A:$A,0))
This is the formula in cell J2:
=IF(INDEX($D:$D,MATCH($H2,$A:$A,0))=0,OFFSET(INDEX($D:$D,MATCH($H2,$A:$A,0)),1,0))
This is the formula in cell K2:
=IF(INDEX($E:$E,MATCH($H2,$A:$A,0))=0,OFFSET(INDEX($E:$E,MATCH($H2,$A:$A,0)),2,0))
Hope this helps!
Thanks.
If you want to use vlookup instead of index and match, you could use a helper column:
The formula in cell 1 is:
=B2&C2
The formula in cell H2 is:
=IF(ISERROR(VLOOKUP($H2&RIGHT(I$1,1),$A$2:$C$8,RIGHT(I$1,1),0)),0,VLOOKUP($H2&RIGHT(I$1,1),$A$1:$F$8,RIGHT(I$1,1)+3,0))
To make the formula be the same in all cells in the output table, I have used the rightmost character in the column name as an index. Hard coding this value, or adding a helper row, would make it easier to read.

Get the count of not null values before the cell

As shown in the image in Col2 I need to get the count of not null values in the Col1 before the cell.
For cell B2 there is only one value A hence 1.
For cell B4 it should be 2 as there are 2 values A & C.
Same way for B5, 3 (A,C,D)
Data:
A B
1 Col1 Col2
2 A 1
3
4 C 2
5 D 3
6
7 F 4
I have tried:
B1 Cell = COUNTA(A2:A2)
B2 Cell = COUNTA(A2:A3)
B3 Cell = COUNTA(A2:A4)
However I cannot drag this formula as it will change the cell reference.
Can anyone suggest any way to get this done in a single formula which can be applied to all the cells through out the column.
Try this:
=IF(A2<>"",COUNTA($A$2:A2),"")

Excel if vaules of 2 columns match then take the difference of another two columns

I have 4 columns of data. I want to match the values of two of the columns then if take the difference of two other columns if the first two match. So it's accounts and amounts.
Example. If col A matches Col C take the difference of Col B and Col D and Out it in Col E
Col A Col B Col C Col D Col E
1234 $100 1234 $100 $0
1235 $120 1235 $150 $-30
1236 $150 1237 $150
1238 $130
=IF(A1=B1,C1-D1,)
A1 and B1 are cell references to values you are comparing, and C1 and D1 are cell references to the values you are trying to take the difference of. If you'd like to have the cell be blank instead of 0, add "" after the last comma.
Assuming first data row to be A2:E2, Please put below mentioned formula in cell E2
=IF(A2=C2,B2-D2)
Similarly you can do reverse action by like if it is not then add them or put 0 or blank by "" or subtract B2 from D2 by below given options.
=IF(A2=C2,B2-D2,B2+D2)
=IF(A2=C2,B2-D2,0)
=IF(A2=C2,B2-D2,"")
=IF(A2=C2,B2-D2,D2-B2)
Hope this would help!

copy rows after each other excel

I have a Microsoft excell file: I want to copy 2 rows and add these to the previous row (the first row). I give an example:
row1 -> 0027448 R 3 1 203,45 22375 EDS001 name1 name1 eds1
row2 -> 0027448 R 3 1 203,45 22375 EDS001 name2 name2 eds1
row3 -> 0027448 R 3 1 203,45 22375 EDS001 name3 name3 eds1
My question is: how can I copy row1, row2 and row3 after each other:
course without manually copying. but through formulas!
row1 ... row2 ... row3 ....
This program made ​​me more or less a good solution. Better solutions are still welcome!
I got the Excel plugin from this website: ASAP Utilities
How can I copy row1, row2 and row3 after each other? Of course without manually copying.
If you need copying after each other vertically, row by row, that seems to be simple.
In the very left cell of town you can just paste link to the very first cell of row1 (like: =A1).
Stretch it horizontally, then stretch the whole row1 (with formulas) vertically to the bottom.
This will copy itself, so rows 4,5,6 will copy rows 1,2,3.
Rows 7,8,9 will copy rows 4,5,6 (and again, it will be equal to rows 1,2,3) and so on as long as you need.

Resources