How read values from certain cells in a spreadsheet beyond VLOOKUP? - excel-formula

I have report with ID and values in columns. Values are determined 'TRUE' in column. Do you know how make report with two column with ID and value, for e.g.
At the top is the original report and at the bottom of the expected effect.
How macro to write. This is a simple example, in the future I'll have a more rows with ID and handiwork will be impossible...
Thanks for help!

In your simple example, use the formula =MATCH(TRUE,B2:F2) in B12
In this more generic example
Key 101 102 103 104 105
A1 TRUE
A2 TRUE
A3 TRUE
A4 TRUE
A5 TRUE
A6 TRUE
A7 TRUE
A8 TRUE
Key Val
A1 105
A3 102
A8 105
A5 103
A6 101
A7 105
, I used
=INDEX($1:$1,1,MATCH(TRUE,OFFSET($1:$1,MATCH(A12,A$2!:A$9),0)))

Use the below formula in cell B13, then drag it down to the rest :)
=MATCH(TRUE,INDIRECT(CONCATENATE(MATCH(A13,$A$1:$A$8,0),":",CONCATENATE(MATCH(A13,$A$1:$A$8,0))),TRUE),0)-1

Related

Lookup last non blank cell associated with a value

I have a table with two columns, ID and Value. Each Value is associated with an ID. However, some Values are blank.
My table
ID Value
A2 102
A3 108
A4
A2 148
A3 91
A5 13
A3 Dog
A4 119
A5 58
A3
A4 Cat
A6
I want to look up the last non blank Value for each ID. I need this to work for all data types (numbers, strings, dates, etc). Also, some IDs may have no values at all. The formula should return "" for these.
Desired results below
ID Last Value
A2 148
A3 Dog
A4 Cat
A5 58
A6
What I've tried
=LOOKUP(9.99999999999999E+307,IF(A2:A12=D2,IF(ISNUMBER(B2:B12),B2:B12))) This works but only for numbers.
=LOOKUP(2,1/($A$2:$A$12=D2),$B$2:$B$12) Returns 0, which is the blank for A3.
=LOOKUP(2,1/(NOT(ISBLANK(B2:B12))),B2:B12) Returns 92, which is simply the last value.
=LOOKUP(2,1/($A$2:$A$12=D2),(NOT(ISBLANK($B$2:$B$12)))) Returns FALSE is there is a blank and TRUE is there are no blanks.
=LOOKUP(2,1/($A$2:$A$12=D2),NOT(ISBLANK($B$2:$B$12)),$B$2:$B$12) but the syntax is incorrect (too many arguments).
You can do something like this (as an array formula)

Reference a cell of other worksheet while incrementing the Row number by 15 every time

I am trying to get value of sheet 1 cell "A19" in cell "A1" of sheet 2 and sheet 1 cell "A36" (which is 19+15) in cell "A2" of sheet 2. Do not want to use VBA as the number of rows in the sheets is high. have tried indirect function but havent been able to figure out how to reference cell from other workbook. is there any way this could be done?
In Sheet2, cell A1 enter:
=INDEX(Sheet1!A:A,19+(ROWS($1:1)-1)*17)
and copy down.
This will retrieve the data from these rows:
19
36
53
70
87
104
121
138
155
172
189
206
That is because the increment between 19 and 36 is 17.If you really want the increment to be 15, then substitute 15 in the top equation before the copy-down.
As you have said, you can also use INDIRECT , but INDIRECT is volatile so INDEX is a better choice
=INDIRECT("Sheet1!A"&1+(ROW()-1)*2)

Match two column values from 2 data sets, then find associated values

The issue I'm having was hard to title, and hard to search as well.
Here's some example data.
A B C D E F
B1 04/14/16 746 B1 04/25/16 2
B1 04/15/16 180 B1 04/30/16 4
B1 04/16/16 494 B1 05/01/16 5
B1 04/17/16 726 B2 04/01/16 1
B1 04/18/16 206 B2 04/03/16 1
B1 04/19/16 22 B2 04/04/16 2
B1 04/20/16 193 B2 04/05/16 2
B1 04/21/16 739 B2 04/12/16 8
B1 04/22/16 926 B2 04/13/16 1
B1 04/23/16 748 B2 04/14/16 2
B1 04/24/16 830 B2 04/15/16 1
B1 04/25/16 272 B2 04/18/16 9
B1 04/26/16 0 B2 04/19/16 1
B1 04/27/16 0 B2 04/26/16 9
B1 04/28/16 0 B2 04/27/16 3
B1 04/29/16 0 B2 04/30/16 1
B1 04/30/16 685 B2 05/02/16 5
B1 05/01/16 770 B2 05/03/16 2
B1 05/02/16 701 B3 04/03/16 3
B1 05/03/16 181 B3 04/04/16 1
B2 04/01/16 77 B3 04/06/16 2
B2 04/02/16 182 B3 04/07/16 1
B2 04/03/16 53 B3 04/09/16 1
B2 04/04/16 32 B3 04/16/16 7
What I'm trying to do is check for matching A and D columns, as well as matching B and E columns. If the columns match I would like to take column F and divide by column C.
Also if there is no match for both A and B column values, then have return those values with a zero.
So for a match:
B1 04/25/16 =2/272
For a non-match:
B1 04/14/16 0
Thank you.
Two INDEX/MATCH Function will do it:
=IFERROR(INDEX($F$1:$F$24,MATCH(1,INDEX(($E$1:$E$24=J2)*($D$1:$D$24=I2),),0))/INDEX($C$1:$C$24,MATCH(1,INDEX(($B$1:$B$24=J2)*($A$1:$A$24=I2),),0)),0)
This is an array formula, Full column references should be avoided as the calculation are exponential and will increase the calculation times.
If a more dynamic range is wanted then use this formula:
=IFERROR(INDEX($F$1:INDEX(F:F,MATCH(1E+99,F:F)),MATCH(1,INDEX(($E$1:INDEX(E:E,MATCH(1E+99,F:F))=J2)*($D$1:INDEX(D:D,MATCH(1E+99,F:F))=I2),),0))/INDEX($C$1:INDEX(C:C,MATCH(1E+99,C:C)),MATCH(1,INDEX(($B$1:INDEX(B:B,MATCH(1E+99,C:C))=J2)*($A$1:INDEX(A:A,MATCH(1E+99,C:C))=I2),),0)),0)
This will find the last cell with data and use that to set the extents of the range. So now as the data grows or shrinks it will only look at the data and not iterate through any more or any less than what is needed to cover the entire data set.

Sum fields in a column if there is an entry in a corresponding row in another column

Assume the following data:
| A B C
--+------------------------
1 | 2 3 5
2 | 2 3
3 | 4 4
4 | 2 3
5 | 5 6
In cell A6, I want Excel to add cells C1, C2, C3 on the basis that A1, A2 and A3 have data in. Similarly, I want B6 to add together C1, C4 and C5 because B1, B4 and B5 have data.
Can someone help?
In A6 enter:
=SUMPRODUCT(($C1:$C5)*(A1:A5<>""))
and then copy to B6:
A simple SUMIF formula will work
=SUMIF(A$1:A$5,"<>",$C$1:$C$5)
Place that formula is cell A6 and then copy it to B6.
You can create another column, e.g. AValue, with the formula =IF(ISBLANK(A1),0,A1) in it. This will return 0 if the cell in A in the corresponding line is empty, or the value from the cell in A otherwise.
Then you can just sum up the values of the new column.

Find text in column one and copy value from next column to column 3 in Excel [duplicate]

This question already has answers here:
Check if Cell value exists in Column, and then get the value of the NEXT Cell
(3 answers)
Closed 8 years ago.
Column 1 in my spread sheet contains text (just 1 word), 2nd column numbers and column 3 will have those numbers in specific order.
Example:
cell values
A3 aaaa
A4 bbbb
A5 cccc
A6 dddd
A7 eeee
A8 ffff
B3 11
B4 22
B5 33
B6 44
B7 55
B8 66
I want cell C3 to search the whole column A for a word ffff and once it found it, it would copy a value of the cell next to it in column B. So if the word ffff was in cell A8 the cell C3 would be 66 as B8=66. If ffff was in A5 than C3 would be 33 etc. After that I want C4 to find a word cccc in column A and copy value from next cell in column B and so on. Does anyone know how can I do it? Can this be done without using macros?
You can use VLOOKUP function, e.g. in C3
=VLOOKUP("ffff",A:B,2,FALSE)
the 2 tells Excel to return the value from column 2 of the specified range (A:B) and FALSE means that only exact matches are considered - see Excel help for more on VLOOKUP

Resources