Find Cell Value in Data and Return Value of the Cell to the Right

Bkisley

Board Regular
Joined
Jan 5, 2017
Messages
100
Here is an example data set - a series of cash flows

A1: 0 A2: -50 A3: -25 A4: 50 A5: 80 A6: 100

I need the following...
In the first cell (B1) I need to have the first year of cash flow regardless of whether the cell is < or > 0
In the next cells (B2) I need to have an equation that looks up the value in B1 in the series A1:A6 and then return the cell value to the right of that value.

Needed output
B1: -50 B2: -25 B3: 50 B4: 80 B5: 100 B6:0 B7...:0


A different set of data...
A1: 0 A2: 0 A3: 0 A4: -50 A5: 20 A6: 30 A7: 50 A8: 90

Needed Output
B1: -50 B2: 20 B3: 30 B4: 50 B5: 90 B6:0 B7....:0


THANK YOU!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
The formula in B1 will be =A2
but you say
In the next cells (B2) I need to have an equation that looks up the value in B1 in the series A1:A6 and then return the cell value to the right of that value.
Looking up the value in B1 (-50), it is found in A2 and the cell to the right of A2 is B2....which is where the formula will go....which makes a circular reference.
Please restate your request.
 
Upvote 0
wow ok I see what I did....let me correct this!

Here is an example data set - a series of cash flows

A1: 0 B1: -50 C1: -25 D1: 50 E1: 80 F1: 100

I need the following...
In the first cell (B1) I need to have the first year of cash flow regardless of whether the cell is < or > 0
In the next cells (B2) I need to have an equation that looks up the value in B1 in the series A1:A6 and then return the cell value to the right of that value.

Needed output
A2: -50 B2: -25 C2: 50 D2: 80 E2: 100 F2:0 G2...:0
 
Upvote 0
A2 = =B1
B2 = =IFERROR(INDEX($A$1:$F$1,,MATCH(A2,$A$1:$F$1,0)+1),0)
and drag-copy B2 to C2:F2

Problem is that if a number in A1:F1 is repeated, the formula will always return the value to the right of the leftmost instance of the repeated number.
 
Upvote 0
Not sure if this is what you want

=IFERROR(INDEX(1:1,SMALL(IF(1:1<>0,COLUMN(1:1)),COLUMNS($A$1:A1))),"")

and then CTRL SHIFT ENTER

Drag across A2:D2 or more
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top