If Statment Help

Huizar

Board Regular
Joined
Aug 11, 2016
Messages
80
Number
Fill
Address
1026
902 E. Fremont
902 E. Fremont
1063
871 Main Street
829 Main

<tbody>
</tbody>
1263


Hello All, I need help. I'm looking for statement that will help me fill the middle Column. For Example, If the address ha a row number then fill it with the number column number with the number assuming the address Is identical. If No number for the address, then leave it blank. I put a table as an example.

Thank you!!
 

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
8,984
Is this what you want?

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Number</td><td style=";">Fill</td><td style=";">Address</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;;">1026</td><td style=";">1026 E. Fremont</td><td style=";">902 E. Fremont</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;"></td><td style=";"></td><td style=";">902 E. Fremont</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style="text-align: right;;">1063</td><td style=";">1063 Main Street</td><td style=";">871 Main Street</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;"></td><td style=";"></td><td style=";">829 Main</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style="text-align: right;color: #333333;;"></td><td style=";"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style="text-align: right;color: #333333;;">1263</td><td style=";"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">8</td><td style="text-align: right;;"></td><td style=";"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet7</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B2</th><td style="text-align:left">=IF(<font color="Blue">A2="","",IF(<font color="Red">ISNUMBER(<font color="Green">LEFT(<font color="Purple">C2</font>)+1</font>),A2 &MID(<font color="Green">C2,FIND(<font color="Purple">" ",C2&" "</font>),99</font>),""</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 

Huizar

Board Regular
Joined
Aug 11, 2016
Messages
80
Hey Eric,

Thanks for the response. Did you see the address match? Then can the formula bring down 1026? so in Other words row 2 and 3 should have 1026.

Thanks!!
 

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
8,984
OK, try this:

B2: =IF(AND(C2=C1,A2=""),B1,IF(A2="","",IF(ISNUMBER(LEFT(C2)+1),A2 &MID(C2,FIND(" ",C2&" "),99),"")))
 
Last edited:

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,886
Perhaps:
=IF(AND(A2<>"",C2<>""),A2&" "&REPLACE(C2,1,FIND(" ",C2),""),IF(C2=C1,B1,""))

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Number</td><td style=";">Fill</td><td style=";">Address</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;;">1026</td><td style=";">1026 E. Fremont</td><td style=";">902 E. Fremont</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;"></td><td style=";">1026 E. Fremont</td><td style=";">902 E. Fremont</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style="text-align: right;;">1063</td><td style=";">1063 Main Street</td><td style=";">871 Main Street</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;"></td><td style=";"></td><td style=";">829 Main</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style="text-align: right;;">1263</td><td style=";"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B2</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A2<>"",C2<>""</font>),A2&" "&REPLACE(<font color="Red">C2,1,FIND(<font color="Green">" ",C2</font>),""</font>),IF(<font color="Red">C2=C1,B1,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B3</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A3<>"",C3<>""</font>),A3&" "&REPLACE(<font color="Red">C3,1,FIND(<font color="Green">" ",C3</font>),""</font>),IF(<font color="Red">C3=C2,B2,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B4</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A4<>"",C4<>""</font>),A4&" "&REPLACE(<font color="Red">C4,1,FIND(<font color="Green">" ",C4</font>),""</font>),IF(<font color="Red">C4=C3,B3,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B5</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A5<>"",C5<>""</font>),A5&" "&REPLACE(<font color="Red">C5,1,FIND(<font color="Green">" ",C5</font>),""</font>),IF(<font color="Red">C5=C4,B4,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B6</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A6<>"",C6<>""</font>),A6&" "&REPLACE(<font color="Red">C6,1,FIND(<font color="Green">" ",C6</font>),""</font>),IF(<font color="Red">C6=C5,B5,""</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 

Huizar

Board Regular
Joined
Aug 11, 2016
Messages
80
Hey Scott, is there a way a just to bring in the Number in Cell B (i.e. only 1026).

Thanks!
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,886
Like this?

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">Number</td><td style=";">Fill</td><td style=";">Address</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style="text-align: right;;">1026</td><td style="text-align: right;;">1026</td><td style=";">902 E. Fremont</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;"></td><td style="text-align: right;;">1026</td><td style=";">902 E. Fremont</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style="text-align: right;;">1063</td><td style="text-align: right;;">1063</td><td style=";">871 Main Street</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;"></td><td style=";"></td><td style=";">829 Main</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style="text-align: right;;">1263</td><td style=";"></td><td style="text-align: right;;"></td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B2</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A2<>"",C2<>""</font>),A2,IF(<font color="Red">C2=C1,B1,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B3</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A3<>"",C3<>""</font>),A3,IF(<font color="Red">C3=C2,B2,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B4</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A4<>"",C4<>""</font>),A4,IF(<font color="Red">C4=C3,B3,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B5</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A5<>"",C5<>""</font>),A5,IF(<font color="Red">C5=C4,B4,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B6</th><td style="text-align:left">=IF(<font color="Blue">AND(<font color="Red">A6<>"",C6<>""</font>),A6,IF(<font color="Red">C6=C5,B5,""</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 

Forum statistics

Threads
1,082,130
Messages
5,363,333
Members
400,726
Latest member
Shahzad Taimoor

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top