Formula that shows either name or id from its number.

Kartiksvn

New Member
Joined
Dec 31, 2018
Messages
26
Office Version
  1. 2019
Platform
  1. Windows
numbernameid
1aaa1234
2bbb
3ccc1111
4ddd
5eee5678

I want a formula that shows either name or id from its number. If id is empty then shows name like below. I wanna put formula in 'name/id' column.

numbername/id
2bbb
11234
55678
4ddd

Thank you in advance and i really need help on this.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
number​
name​
id​
name/id​
1​
aaa​
1234​
1234​
2​
bbb​
bbb​
3​
ccc​
1111​
1111​
4​
ddd​
ddd​
5​
eee​
5678​
5678​
=IF(C2,C2,B2)
 
Upvote 0
I used vlookup formula in name/id column like this =VLOOKUP(A2,SourceA2:C6,3) but I doesn't have conditional formula which help me to show name if source column id is null than you must show its name.
 
Upvote 0
Code:
=IF(VLOOKUP(A2,Source!$A$1:$C$6,3,0),VLOOKUP(A2,Source!$A$1:$C$6,3,0),VLOOKUP(A2,Source!$A$1:$C$6,2,0))
 
Upvote 0
number​
name​
id​
name/id​
1​
aaa​
1234​
1234​
2​
bbb​
bbb​
3​
ccc​
1111​
1111​
4​
ddd​
ddd​
5​
eee​
5678​
5678​
=IF(C2,C2,B2)
That formula is useful but I have two different sheets and lots off entries with different gapes between each cell of name/id column so I can't copy paste it or scroll down. each and every time I have to input that formula. so can you help me on vlookup formula? which is really helpfull.
 
Upvote 0
can you paste a sample screenshot? or use a sample data using a XL2BB tool to help us know how exactly your input sheet and your output sheet look like?
below is the screenshot of where you need to click in order to down the XL2BB tool. It's exactly above the space where you are posting the comments now.


1628496999895.png
 
Upvote 0
Code:
=IF(VLOOKUP(A2,Source!$A$1:$C$6,3,0),VLOOKUP(A2,Source!$A$1:$C$6,3,0),VLOOKUP(A2,Source!$A$1:$C$6,2,0))
Thank you so much for this help, But I need little more. This formula is only work for numeric id, and I have some id with special characters or alphabets. Can you help me on that please?
 
Upvote 0
can you paste a sample screenshot? or use a sample data using a XL2BB tool to help us know how exactly your input sheet and your output sheet look like?
below is the screenshot of where you need to click in order to down the XL2BB tool. It's write above the space where you are posting the comments now.



View attachment 44404
 
Upvote 0
can you paste a sample screenshot? or use a sample data using a XL2BB tool to help us know how exactly your input sheet and your output sheet look like?
below is the screenshot of where you need to click in order to down the XL2BB tool. It's exactly above the space where you are posting the comments now.


View attachment 44404
That formula is useful but I have two different sheets and lots off entries with different gapes between each cell of name/id column so I can't copy paste it or scroll down. each and every time I have to input that formula. so can you help me on vlookup formula? which is really helpfull.
SAMPLE 2021.xlsx
ABC
2ABNAME (A-B)BANK NAME
31ALPESH CHAMARADI
42MEHUL CHAMARADI
53MILAN CHAMARADI
64SUNIL CHAUHAN (ASSORT)
75SHAILESHBHAI B. JANI (ASSORT)
86KISHORBHAI JETHAVA (ASSORT)
97JITENDRABHAI JETHAVA (ASSORT)
108GOPAL B. CHAUHAN (ASSORT)
119KETAN CHAUHAN (ASSORT)
1210RASIKBHAI G. JASOLIYA (ASSORT)
1311PARESHKUMAR B. GOHIL (ASSORT)
1412RAJUBHAI G. KADOLIYA (ASSORT)
1513RAJUBHAI BARAIYA (ASSORT)
1614GOPALBHAI C. CHAUHAN (ASSORT)
1715DINESHBHAI V. PARMAR (ASSORT)
1816DHARMESH DAVE (ASSORT)
1917BHAVESHBHAI M. CHOTALIYA (ASSORT)
2018TUSHARBHAI CHAUHAN (MARKER)
2119HASAMUKHBHAI D. DABHI (MARKER)
2220JITENDRABHAI SHAH (ASSORT)
2321DAYABHAI SOLANKI (MARKER)
2422RAVIBHAI DIHORA (ASSORT)
A-B




SAMPLE 2021.xlsx
ABCDEFG
1
2ABALPESH CHAMARADI
31AUGUST*(2021)શીખાવ ના જમા -
4# દરેક સ્ટાફ મેમ્બરો નો પગાર વધારો જાન્યુઆરી મહિના ના પગાર વખતે જ થશે.
5# આથી પગાર વધારા માટે ચાલુ વર્ષ કે દિવાળી પર કોઈએ રજૂઆત કરવી નહિ.
6# નવા શીખાવ નો બે મહિના નો પગાર જમા રહેશે તથા બે વર્ષ બાદ જ મળશે.
7BANK NAMEALPESH CHAMARADI
8A/C NO.CASH
9IFSC CODEICIC0006550બોનસ0
A-B SLIP
Cell Formulas
RangeFormula
B2B2=VLOOKUP(A3,'A-B'!$A$3:$P$42,2)
B3B3='A-B'!A1
C7C7=IF(VLOOKUP(A3,'A-B'!A3:P42,3,0),VLOOKUP(A3,'A-B'!A3:P42,3,0),VLOOKUP(A3,'A-B'!A3:P42,2,0))
C8C8=VLOOKUP(A3,'A-B'!$A$3:$P$42,5)
C9C9=VLOOKUP(A3,'A-B'!$A$3:$P$42,4)
G9G9=VLOOKUP(A3,'A-B'!$A$3:$P$42,15)
 
Upvote 0
consider ID as Bank name. This is my real sheet. I want a formula for C7 cell. and as shown in first sheet I need bank name instead of ID in first example.
thank you for your help.
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,981
Members
449,058
Latest member
oculus

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