Help with repeating formula until condition is met

Joined
Jan 12, 2022
Messages
5
Office Version
  1. 2016
Platform
  1. MacOS
Hey everyone, new guy here, so sorry in advance if the question isn't posed in the clearest of manners.

Anyway, I'm trying to get Table 2 (as shown below) from Table 1, while trying to avoid macros, since I don't comprehend them yet. For the sake of this example let's say the "name" Column is A and "e-mail" Column is B, and the rows follow the same logic.

So basically, I want Table 2's A2 cell, and all following rows, to be filled with the text from Table 1's A column, so long as there is a corresponding e-mail in Table 1's B column, ignoring all Presidents without an e-mail. This repeated testing for that condition should continue through a certain range of Table 1's A column. It should also be noted that all of Table 1's B column cells without an e-mail, are filled with "-".

Then, a similar formula will have to be created for Table 2's "e-mail" (B) column, but I feel like I can get that done when I understand the logic behind what has to be done in the A column.

Once again, sorry for not using XL2BB to make your lives easier, but I ran into an error when trying to use it, and I was in a hurry to post this.

Thanks in advance for the help!

Table 1
namee-mail
President of Campo de Ouriquethisemailisfictitious@gmail.com
President of Somewhere Else-
President of Mordor-
President of Flatlandthisemailisfictitiousaswell@gmail.com

Table 2
namee-mail
President of Campo de Ouriquethisemailisfictitious@gmail.com
President of Flatlandthisemailisfictitiousaswell@gmail.com
 
Joined
Jan 12, 2022
Messages
5
Office Version
  1. 2016
Platform
  1. MacOS
So the final solution was @ExceLoki original formula for E2:

=VLOOKUP(D2,A$2:B$5,2,FALSE)

And for D2, either one of the following will do the trick (credit to both @ExceLoki and @Fluff ):

=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(A:A)/(B:B<>"-"),ROW(A2))),"")
=IFERROR(INDEX($A$2:$A$1000,AGGREGATE(15,6,(ROW($A$2:$A$1000)-ROW($A$2)+1)/($B$2:$B$1000<>"-"),ROWS(D$2:D2))),"")
 

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.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
77,713
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 

Forum statistics

Threads
1,176,138
Messages
5,901,574
Members
434,906
Latest member
Prabhu_Churi

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
Top