Extension to IF formula needed

saraapple

Board Regular
Joined
Feb 3, 2020
Messages
165
Office Version
  1. 2010
Platform
  1. Windows
I have a simple IF formula as follows:
=IF(B1=265,(Sheet4!A1),(""))

What I would like to do is for each time it finds "265" in column B I want it to return (Sheet4!A1) then (Sheet4!A2) then (Sheet4!A3) etc. I have tried various $ and it will not work, I am thinking that I perhaps need to include an INDEX?
Any help gratefully appreciated.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi
What about
Excel Formula:
=IF(B4=265,"Sheet4!A"&COUNTIF($B$1:$B4,B4),"")
 
Upvote 0
Not totally clear, but do you mean something like this:

ABCD
1265
2P
3265R
4W
5
6
7
8265
Sheet3
Cell Formulas
RangeFormula
D2:D4D2=IFERROR(INDEX(Sheet4!A$1:A$10,SMALL(IF(B$1:B$10=265,ROW(B$1:B$10)-ROW(B$1)+1),ROWS(D$2:D2))),"")


A
1P
2Q
3R
4S
5T
6U
7V
8W
9X
10Y
Sheet4
 
Upvote 0
Apologies I have not been clear on what I need!
The first suggestion from @[U]mohadin[/U] almost works but I want it to return the contents of the cell in sheet4 cell A1 - this formula returns the text "Sheet4A1" then for the next 265 it returns "Sheet4!A2". How can I make it return the value of these cells?
 
Upvote 0
Then try
Excel Formula:
=IF(B4=265,INDIRECT("Sheet4!A"&COUNTIF($B$1:$B4,B4)),"")
 
Upvote 0
Similar, but without the volatile INDIRECT ...

ABCD
1265P
2 
3265Q
4 
5 
6 
7 
8265R
9 
10 
Sheet3
Cell Formulas
RangeFormula
D1:D10D1=IF(B1=265,INDEX(Sheet4!A:A,COUNTIF(B$1:B1,265)),"")

A
1P
2Q
3R
4S
5T
6U
7V
8W
9X
10Y
Sheet4
 
Upvote 0

Forum statistics

Threads
1,215,642
Messages
6,125,987
Members
449,276
Latest member
surendra75

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