How to use formula in cell with formula

claven123

Board Regular
Joined
Sep 2, 2010
Messages
83
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I want to list the names of members present. I have rows (2-43) with names and columns based on dates and if they are present I put a X in that cell in the column for the date. I want to list only those members with X's in a list.
I was able to create a list in column A with this formula =IF(B2 = "X", A2, ""). This listed the names from A2 down to A43. With blanks for those not present.

Now in cell D2, I have placed this formula. Which lists the names in the D2 going down. So, if 6 people were present, I get a list of 6 names in cells D2-D7. My issue is that the next cell without a corresponding name (D8) will give me a #NUM! error. If I remove the formula in column A the error resolves.

=IF(ROWS(D$2:D2)>COUNTA($A$2:$A$25),"",INDEX($A$2:$A$25,AGGREGATE(15,6,(ROW($A$2:$A$25)-ROW($A$2)+1)/($A$2:$A$25<>""),ROWS(D$2:D2))))

This formula is a bit too complex for me to be able to fix it, any suggestions.

D
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Try:
Also, shouldn't your range be A2:A43?
What version of Excel are you using?
=IFERROR(INDEX($A$2:$A$25,AGGREGATE(15,6,(ROW($A$2:$A$25)-ROW($A$2)+1)/($A$2:$A$25<>""),ROWS(D$2:D2))),"")
 
Upvote 0
Try:
Also, shouldn't your range be A2:A43?
What version of Excel are you using?
=IFERROR(INDEX($A$2:$A$25,AGGREGATE(15,6,(ROW($A$2:$A$25)-ROW($A$2)+1)/($A$2:$A$25<>""),ROWS(D$2:D2))),"")

Oops I copied the wrong cell, yes, it is A2:A43
Office 365

This is what I have.

=IF(ROWS(D$2:D2)>COUNTA($A$2:$A$43),"",INDEX($A$2:$A$43,AGGREGATE(15,6,(ROW($A$2:$A$43)-ROW($A$2)+1)/($A$2:$A$43<>""),ROWS(D$2:D2))))

D
 
Upvote 0
With your formula, I get 0 where there is spaces if I have a formula in column A, without formula I get the correct output.

D
 
Upvote 0
How about posting a small sample of your data,
What do you have in each column?
What column has your formula IF(B2 = "X", A2, "")?
What version of Excel do you have (if Excel 365 or 2021 there may be a better formula)?
 
Upvote 0
If you have names in one column and an x in the date column then why not use something like the example below.

Book2
ABC
1NamesDate
2Name1xName1
3Name2Name4
4Name3Name7
5Name4xName8
6Name5Name10
7Name6 
8Name7x 
9Name8x
10Name9
11Name10x
12Name11
13Name12
Sheet2
Cell Formulas
RangeFormula
C2:C8C2=IFERROR(INDEX($A$2:$A$43,AGGREGATE(15,6,(ROW($A$2:$A$43)-ROW($A$2)+1)/($B$2:$B$43="x"),ROWS($C$2:C2))),"")
 
Upvote 0
Office 365

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
I updated my account details, sorry about that.

AhoyNC's solution worked. I was trying to combine the two and that accomplished it perfectly. Much better solution than what I was working on.

Thanks for the help, very appreciated.

D
 
Upvote 0
As you have 365 you could also use
Fluff.xlsm
ABC
1NamesDate
2Name1xName1
3Name2Name4
4Name3Name7
5Name4xName8
6Name5Name10
7Name6
8Name7x
9Name8x
10Name9
11Name10x
12Name11
13Name12
Master
Cell Formulas
RangeFormula
C2:C6C2=FILTER(A2:A100,B2:B100="x")
Dynamic array formulas.
 
Upvote 0
Glad we could help. The FILTER option that @Fluff posted would be the better way to go since you have Excel 365.
Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

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