Excluding the Initial Cell from a Range in a Formula

newexceluser1

New Member
Joined
Oct 12, 2018
Messages
3
Hello,

I am currently looking for a way to exclude a referenced Cell from an Excel formula but I'm fairly new to Excel. The function I am currently using is used to generate a referenced Cell based on "duplicated" information in the Cell (IE. If A1 has "Text", and A4 has "Text", C3 will generate "A4" as text) within the range. Here's a summary of what I'm trying to do as well as where the issue lies:

Expected
Cell A2 has "Test" text inputted
Cell A4 has "Test" text inputted
Cell C2 searches through range A2:A300 for any cells that contain the same text and then spits out the referenced Cell as text (NOT the contents of the referenced cell)
Cell C2 generates "$A$4", desired result
Cell C4 generates "$A$4", not desired result (should be $A$2)

Here is the function being used: =CELL("address",INDEX($A$2:$A$300,MATCH(A2,$A$2:$A$300,1)))

The byproduct of using this function is that the referenced Cell that is generated always seems to be the last "duplicate" within the range, but this is fine.

Example
A2 = Test
C2 = A$2$

A2 = Test
A4 = Test
C2 = A$4$

A2 = Test
A4 = Test
A8 = Test
C2 = A$8$

Is the function/formula I am looking for possible? Any help or guidance would be greatly appreciated.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Is the input either Test or nothing at all?
It will vary- for context, the input is a list that will be contributed to (IE. specific text) and I want to ensure that there are no instances of the same text and that if there is, the adjacent 'C' Cell will generate the Cell that contains an instance of the inputted text.

Example
A1 - Test1
A2 - Test2
A3 - Test3
A4 - Test4
etc.
 
Upvote 0

Book1
ABC
2Test$A$3, $A$5
3Test$A$2, $A$5
4WAD$A$6
5Test$A$2, $A$3
6WAD$A$4
Sheet1


In C2 control+shif+enter, not just enter, and copy down:

=IF(MAX(FREQUENCY(IF($A$2:$A$6<>"",IF($A$2:$A$6=$A2,MATCH($A$2:$A$6,$A$2:$A$6,0))),ROW($A$2:$A$6)-ROW($A$2)+1))>1,TEXTJOIN(", ",TRUE,SUBSTITUTE(ADDRESS(IF($A$2:$A$6=$A2,ROW($A$2:$A$6),ROW($A2)),COLUMN($A$2)),CELL("address",$A2),"")),"")

Note. A solution using VBA would be preferable.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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