I have two sheets, one containing user-entered data, and a second containing a bunch of data. I have included example sheets at the bottom of this question.
I'm trying to build a formula that for each row in the user-entered sheet would return 1 or more rows. I have a formula that works when only one row exists in the user-entered sheet but stops working as soon as there are multiple, because I'm using BYROW which expands into multiple rows.
I know I can use ={ range1; range2 } syntax to join ranges, but I'm unsure how to do that with what I have.
The formula in question:
=BYROW( IFERROR( FILTER( UserData!$B$3:$D$19, NOT(ISBLANK(UserData!$B$3:$B$19)) ) ), LAMBDA( row, FILTER( DataSheet!$D$2:$G, DataSheet!$A$2:$A = INDEX(row, 1, 1), (ISBLANK(DataSheet!$B$2:$B))+(DataSheet!$B$2:$B = INDEX(row, 1, 2)), INDEX(row, 1, 3) >= DataSheet!$C$2:$C ) ))What is the solution to this? The order of the data returned by the formula is important.
User entered data:
| B | C | D |
|---|---|---|
| Category1 | Cat1Subcat5 | 3 |
| Category4 | Cat4Subcat3 | 2 |
Data reference sheet:
| Categories | Subcategories | Value | Name | Source | ? | Description |
|---|---|---|---|---|---|---|
| Category1 | 1 | Cat1Item1 | src | Description for Cat1Item1 | ||
| Category1 | 2 | Cat1Item2 | src | Description for Cat1Item2 | ||
| Category1 | Cat1Subcat1 | 3 | Subcat1Item1 | src | Description for Subcat1Item1 | |
| Category1 | Cat1Subcat2 | 3 | Subcat2Item1 | src | Description for Subcat2Item1 | |
| Category1 | Cat1Subcat3 | 3 | Subcat3Item1 | src | Description for Subcat3Item1 | |
| Category1 | Cat1Subcat4 | 3 | Subcat4Item1 | src | Description for Subcat4Item1 | |
| Category1 | Cat1Subcat5 | 3 | Subcat5Item1 | src | Description for Subcat5Item1 | |
| Category4 | 1 | Cat4Item1 | src | Description for Cat4Item1 | ||
| Category4 | 2 | Cat4Item2 | src | Description for Cat4Item2 | ||
| Category4 | Cat4Subcat3 | 3 | Cat4Subcat3Item1 | src | Description for Cat4Subcat3Item1 |
An example desired result from the formula would be:
| Name | Source | ? | Description |
|---|---|---|---|
| Item1 | src | Description for item1 | |
| Item2 | src | Description for item2 | |
| Subcat5Item1 | src | Description for Subcat5Item1 | |
| Cat4Item1 | src | Description for Cat4Item1 | |
| Cat4Item2 | src | Description for Cat4Item2 |