Auto-filling the address column with info from data sheet

Hunk1

New Member
Joined
Feb 2, 2023
Messages
9
Office Version
  1. 2016
Platform
  1. Windows
Hello there,

I want excel to search up a address and fill up the numbers according to people living on the house, however i crashed trying to do the formula i stopped at:


Excel Formula:
=IF(AND(OR(COUNT.IF('Folha de Assinatura'!C10;"RUA*")=1;(COUNT.IF('Folha de Assinatura'!C10;"AVENIDA*")=1));if('Folha de Assinatura'!C10<>""'Folha de Assinatura'!C10&" , "&'Folha de Assinatura'!C12;"")

the Source Sheet: the address is on column c; i though about doing a IF function to search for "Rua*" or "Avenida*", however i crashed trying to do a simplier function
that would not have like 20 IFs attached to itself:

FOLHA ASS 2022 m03 03-02-2023.xlsm
ABCDEFGH
10RUA NATERCIA 37504080
11FANOMED. NASC.CARTÃO DO SUSDOENÇA DATA VDASSINATURA
12159BENEDITO GONCALVES FILHO9010/05/1951702103775242996HA/DIA*
13
14160TERESINHA DE FATIMA DA SILVA 6001/04/1973708504337827477FU
15RICARDO MARCOS DE ARAUJO18/06/1971772.478.686-00HA/FU
16FILIPE MARCOS ARAUJO02/07/1993117.995.396-79FU
17
18AVENIDA PRESIDENTE TANCREDO NEVES 37504066
Folha de Assinatura



the Destination Sheet:
Cell Formulas
RangeFormula
B10:B14B10='Folha de Assinatura'!B12
C10:C14,E10:E14C10='Folha de Assinatura'!D12
D10:D14D10=RIGHT(C10,4)
F10:G14F10='Folha de Assinatura'!I12
H10H10=IF(AND(COUNTIF('Folha de Assinatura'!C10,"RUA*")),'Folha de Assinatura'!C10&" , "&'Folha de Assinatura'!C12,"")
H12,H14H12=IF(AND(A12<>"",B12<>""),'Folha de Assinatura'!$C$10&" , " &'Folha de Assinatura'!C14,IF(B12<>"",'Folha de Assinatura'!C12&" , " &'Folha de Assinatura'!C14,""))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E10:E1089Cell Value="SEM DOEN."textNO
D10:D1089Cell Valuebetween 2004 and 2023textNO
F9:G9Cell Valuecontains "f"textNO
F9:G9Cell Valuecontains "M"textNO
E9:E1089Celldoes not contain a blank value textNO
B10:B1089Cell ValueduplicatestextNO
B10:B1089Cell ValueduplicatestextNO
B10:B1089Cell ValueduplicatestextNO



The expected Result:

Cell Formulas
RangeFormula
B10,B27:B32,B19:B20,B12:B14B10='Folha de Assinatura'!B12
C10,E27:E32,C27:C32,E19:E20,C19:C20,E12:E14,C12:C14,E10C10='Folha de Assinatura'!D12
D10,D27:D32,D19:D20,D12:D14D10=RIGHT(C10,4)
G27:G32,G19:G20,F12:G14,F10:G10F10='Folha de Assinatura'!I12
H10H10=IF(AND(COUNTIF('Folha de Assinatura'!C10,"RUA*")),'Folha de Assinatura'!C10&" , "&'Folha de Assinatura'!C12,"")
F19F19='Folha de Assinatura'!I22
F20,F27:F32F20='Folha de Assinatura'!I24
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E10:E1089Cell Value="SEM DOEN."textNO
D10:D1089Cell Valuebetween 2004 and 2023textNO
F9:G9Cell Valuecontains "f"textNO
F9:G9Cell Valuecontains "M"textNO
E9:E1089Celldoes not contain a blank value textNO
B10:B1089Cell ValueduplicatestextNO
B10:B1089Cell ValueduplicatestextNO
B10:B1089Cell ValueduplicatestextNO
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Formula in H10 on the results sheet:
Excel Formula:
=IF(LEN(B10)>1,IF(LEN('Folha de Assinatura'!C12)>0,INDEX('Folha de Assinatura'!C$9:C12,MIN(IFNA(XMATCH("Ave*",'Folha de Assinatura'!C$9:C12,2,-1),10^6),IFNA(XMATCH("Rua*",'Folha de Assinatura'!C$9:C12,2,-1),10^6))) & ", " & 'Folha de Assinatura'!C12,Sheet4!I9),"")
XMATCH (and XLOOKUP) have a parameter to search from the bottom up.
So if there is a name in the B column of the results sheet, and a house number entry in the data sheet, it will find the last streetname used in the column.
If there is nu street number, it will use the number in the cell above.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,394
Members
448,957
Latest member
Hat4Life

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