Help with dynamic formula that will prints text

locksmith55

New Member
Joined
Mar 6, 2022
Messages
22
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to make a dynamic formula in excel that will read when there is 1 inside of a cell and will print the serial number that is above it in column I. I need the formula to work row by row and left to right. If there is a better way to do this using helper columns or chaning the date but still getting the same result, please let me know.

Would prefer if the solution is not too complex. Helper columns are welcome.

Appreciate any help I can get!

Book1
ABCDEFGHIJ
1Serial NumbersRows to print of serial number when 13HOW I WANT IT TO LOOKJust to better visualize data
2VNR12456BRD32561AKK98631BRD32561these are from apple row 3
3Apple010Use of helper columns are welcomeBRD32561
4Mango011BRD32561
5Pear010BRD32561these are from mango row 4
6Banana011BRD32561
7Orange100BRD32561
8AKK98631these are from mango row 4
9AKK98631
10AKK98631
11BRD32561these are from pear row 5
12BRD32561
13BRD32561
14BRD32561these are from banana row 6
15BRD32561
16BRD32561
17AKK98631these are from banana row 6
18AKK98631
19AKK98631
20VNR12456these are from orange row 7
21VNR12456
22VNR12456
Sheet1
Cell Formulas
RangeFormula
I2I2=C2
I3I3=C2
I4I4=C2
I5I5=C2
I6I6=C2
I7I7=C2
I8I8=D2
I9I9=D2
I10I10=D2
I11I11=C2
I12I12=C2
I13I13=C2
I14I14=C2
I15I15=C2
I16I16=C2
I17I17=D2
I18I18=D2
I19I19=D2
I20I20=B2
I21I21=B2
I22I22=B2
 

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.
Not a formula but just a simple macro.
Code:
Sub Maybe()
Dim i As Long, j As Long
ActiveSheet.Columns(5).ClearContents    '<---- Comment out if not needed
    For i = 3 To Cells(Rows.Count, 1).End(xlUp).Row
        For j = 2 To 4
            If Cells(i, j).Value = 1 Then Cells(Rows.Count, 5).End(xlUp).Offset(1).Resize(3).Value = Cells(2, j).Value
        Next j
    Next i
End Sub
 
Upvote 0
See how this goes.

22 07 24.xlsm
ABCDEFGHI
1Serial NumbersRows to print3RESULT
2VNR12456BRD32561AKK98631BRD32561
3Apple010BRD32561
4Mango011BRD32561
5Pear010BRD32561
6Banana011BRD32561
7Orange100BRD32561
8AKK98631
9AKK98631
10AKK98631
11BRD32561
12BRD32561
13BRD32561
14BRD32561
15BRD32561
16BRD32561
17AKK98631
18AKK98631
19AKK98631
20VNR12456
21VNR12456
22VNR12456
23
locksmith55
Cell Formulas
RangeFormula
I2:I22I2=FILTERXML("<p><c>"&REPLACE(CONCAT(IF(B3:D7=1,REPT("</c><c>"&B2:D2,G$1),"")),1,7,"")&"</c></p>","//c")
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,343
Messages
6,124,400
Members
449,156
Latest member
LSchleppi

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