AGrayson84
New Member
- Joined
- Mar 21, 2017
- Messages
- 18
Hi everyone, I was hoping someone may be able to assist me with an unusual request that I have not been able to find a formula for that I have been able to modify successfully. I have a worksheet that contains the many instances of the word "Subnet" within column "D". For each instance of "Subnet" in column D, there is one instance of the word "Gateway" in column D of a below row. Below is a very rough example:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]sdsad[/TD]
[TD]sadas[/TD]
[TD]dfdsf[/TD]
[TD]subnet[/TD]
[/TR]
[TR]
[TD]dfsdfsd[/TD]
[TD]dfds[/TD]
[TD]sadfas[/TD]
[TD]gateway[/TD]
[/TR]
[TR]
[TD]dfsdf[/TD]
[TD]dsfsdf[/TD]
[TD]dsfsd[/TD]
[TD]sdfsf[/TD]
[/TR]
[TR]
[TD]dfsdf[/TD]
[TD]dsfsdf[/TD]
[TD]dsfs[/TD]
[TD]subnet
[/TD]
[/TR]
[TR]
[TD]sdfgs[/TD]
[TD]sdgdh[/TD]
[TD]sdgsdf[/TD]
[TD]dfgfdgh[/TD]
[/TR]
[TR]
[TD]dgsfdgfd[/TD]
[TD]sfsd[/TD]
[TD]dsfsdg[/TD]
[TD]dgfdg[/TD]
[/TR]
[TR]
[TD]fsfgf[/TD]
[TD]gdfgfd[/TD]
[TD]sdgsrr[/TD]
[TD]gateway[/TD]
[/TR]
[TR]
[TD]hfdhggf[/TD]
[TD]sfgfd[/TD]
[TD]dfgsdfg[/TD]
[TD]subnet[/TD]
[/TR]
[TR]
[TD]gsdfgf[/TD]
[TD]sdfsd[/TD]
[TD]fgsdgd[/TD]
[TD]gateway[/TD]
[/TR]
</tbody>[/TABLE]
What I would like to do is have a formula that I can use in column E of each row where "subnet" is in column D, and I would like that formula to find the next instance of "gateway" in column D (it's not always in the very-next row), then write the value of column A of that same row (the "gateway" row) into column E of the subnet row. For instance:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]sdsad[/TD]
[TD]sadas[/TD]
[TD]dfdsf[/TD]
[TD]subnet[/TD]
[TD]dfsdfsd[/TD]
[/TR]
[TR]
[TD]dfsdfsd[/TD]
[TD]dfds[/TD]
[TD]sadfas[/TD]
[TD]gateway[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]dfsdf[/TD]
[TD]dsfsdf[/TD]
[TD]dsfsd[/TD]
[TD]sdfsf[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]dfsdf[/TD]
[TD]dsfsdf[/TD]
[TD]dsfs[/TD]
[TD]subnet[/TD]
[TD]fsfgf[/TD]
[/TR]
[TR]
[TD]sdfgs[/TD]
[TD]sdgdh[/TD]
[TD]sdgsdf[/TD]
[TD]dfgfdgh[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]dgsfdgfd[/TD]
[TD]sfsd[/TD]
[TD]dsfsdg[/TD]
[TD]dgfdg[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]fsfgf[/TD]
[TD]gdfgfd[/TD]
[TD]sdgsrr[/TD]
[TD]gateway[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]hfdhggf[/TD]
[TD]sfgfd[/TD]
[TD]dfgsdfg[/TD]
[TD]subnet[/TD]
[TD]gsdfgf[/TD]
[/TR]
[TR]
[TD]gsdfgf[/TD]
[TD]sdfsd[/TD]
[TD]fgsdgd[/TD]
[TD]gateway[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I believe I do have a VBA Script I am using for something else, that I can easily modify to use for placing the formula for each cell in column "E" where the word "subnet" is found in Column "D". However, Macros are disabled on most of our workstations on the specific domain that this spreadsheet is on, so if there is a way to do it without macro that would be great. But I primarily need just the formula for finding the value of the next instance of the cell in column A, where "gateway" is found in column D of the same row.
Hopefully that's not too confusing and if anyone needs to me to elaborate on anything please let me know. Any help on this would be hugely appreciated! Thanks everyone!
-Andrew
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]sdsad[/TD]
[TD]sadas[/TD]
[TD]dfdsf[/TD]
[TD]subnet[/TD]
[/TR]
[TR]
[TD]dfsdfsd[/TD]
[TD]dfds[/TD]
[TD]sadfas[/TD]
[TD]gateway[/TD]
[/TR]
[TR]
[TD]dfsdf[/TD]
[TD]dsfsdf[/TD]
[TD]dsfsd[/TD]
[TD]sdfsf[/TD]
[/TR]
[TR]
[TD]dfsdf[/TD]
[TD]dsfsdf[/TD]
[TD]dsfs[/TD]
[TD]subnet
[/TD]
[/TR]
[TR]
[TD]sdfgs[/TD]
[TD]sdgdh[/TD]
[TD]sdgsdf[/TD]
[TD]dfgfdgh[/TD]
[/TR]
[TR]
[TD]dgsfdgfd[/TD]
[TD]sfsd[/TD]
[TD]dsfsdg[/TD]
[TD]dgfdg[/TD]
[/TR]
[TR]
[TD]fsfgf[/TD]
[TD]gdfgfd[/TD]
[TD]sdgsrr[/TD]
[TD]gateway[/TD]
[/TR]
[TR]
[TD]hfdhggf[/TD]
[TD]sfgfd[/TD]
[TD]dfgsdfg[/TD]
[TD]subnet[/TD]
[/TR]
[TR]
[TD]gsdfgf[/TD]
[TD]sdfsd[/TD]
[TD]fgsdgd[/TD]
[TD]gateway[/TD]
[/TR]
</tbody>[/TABLE]
What I would like to do is have a formula that I can use in column E of each row where "subnet" is in column D, and I would like that formula to find the next instance of "gateway" in column D (it's not always in the very-next row), then write the value of column A of that same row (the "gateway" row) into column E of the subnet row. For instance:
[TABLE="width: 500"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]sdsad[/TD]
[TD]sadas[/TD]
[TD]dfdsf[/TD]
[TD]subnet[/TD]
[TD]dfsdfsd[/TD]
[/TR]
[TR]
[TD]dfsdfsd[/TD]
[TD]dfds[/TD]
[TD]sadfas[/TD]
[TD]gateway[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]dfsdf[/TD]
[TD]dsfsdf[/TD]
[TD]dsfsd[/TD]
[TD]sdfsf[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]dfsdf[/TD]
[TD]dsfsdf[/TD]
[TD]dsfs[/TD]
[TD]subnet[/TD]
[TD]fsfgf[/TD]
[/TR]
[TR]
[TD]sdfgs[/TD]
[TD]sdgdh[/TD]
[TD]sdgsdf[/TD]
[TD]dfgfdgh[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]dgsfdgfd[/TD]
[TD]sfsd[/TD]
[TD]dsfsdg[/TD]
[TD]dgfdg[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]fsfgf[/TD]
[TD]gdfgfd[/TD]
[TD]sdgsrr[/TD]
[TD]gateway[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]hfdhggf[/TD]
[TD]sfgfd[/TD]
[TD]dfgsdfg[/TD]
[TD]subnet[/TD]
[TD]gsdfgf[/TD]
[/TR]
[TR]
[TD]gsdfgf[/TD]
[TD]sdfsd[/TD]
[TD]fgsdgd[/TD]
[TD]gateway[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I believe I do have a VBA Script I am using for something else, that I can easily modify to use for placing the formula for each cell in column "E" where the word "subnet" is found in Column "D". However, Macros are disabled on most of our workstations on the specific domain that this spreadsheet is on, so if there is a way to do it without macro that would be great. But I primarily need just the formula for finding the value of the next instance of the cell in column A, where "gateway" is found in column D of the same row.
Hopefully that's not too confusing and if anyone needs to me to elaborate on anything please let me know. Any help on this would be hugely appreciated! Thanks everyone!
-Andrew