IF Logic HELP

Walker_Ice

Board Regular
Joined
Oct 6, 2023
Messages
50
Office Version
  1. 2021
Platform
  1. MacOS
Hi everyone,

I have a list of clients called "Client_Clientele". Another list named "Client_Phone" which holds all of their phone numbers associated with those clients. Another list named "Client_Email" which holds all of their emails as well.

I am trying to make a formula work, so that when I start typing a name that is already on the list, it automatically populates the phone numbers and emails. The problem is that when I type in a new name that is not on the list, it gives me the error "#REF". But I want it to stay empty if the name is not on the list "Client_Clientele". Can someone help me modify these formulas to work as desired?
Thank you in advance.


TEsting_Excel_File.xlsx
ABCDEFGHIJKLM
1Client NamePhone #Email Client NamePhone #Email
2XX687-000-0909XX@gmail.comXX687-000-0909XX@gmail.com
3YY687-000-0910YY@gmail.comYY687-000-0910YY@gmail.com
4LIME687-000-0911LIME@gmail.comLIME687-000-0911LIME@gmail.com
5Yellow687-000-0912Yellow@gmail.comYellow687-000-0912Yellow@gmail.com
6Green687-000-0913Green@gmail.comGreen687-000-0913Green@gmail.com
7Blue 687-000-0914Blue@gmail.comBlue 687-000-0914Blue@gmail.com
8Blue  #NAME?
9Yellow #NAME?
10Green #NAME?
11
12
13
Sheet7
Cell Formulas
RangeFormula
B8:B10B8=IF(IFERROR(MATCH(A8, Client_clientele, 0), "")="", "", INDEX(Client_Phone, MATCH(A8, Client_clientele, 0), 1))
C8:C10C8=IF(A8<>"", INDEX(Client_Email, MATCH(A8, Client_clientele, 0)), "")
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
I think with Excel 2021 in your hand you should use XLOOKUP which automatically gives option what to return if not found.

Try that.
 
Upvote 0
Hi Sanjay thank you for your reply,

If i use XLOOKUP, I still get the same error. I tried the following and still received an error when the name was not on the Client_Clientele list. They work great if in cell A8 I am typing in a name that is already existing on the "Client_Clientele list. The problem is when I have a new client, it gives me "#REF" error and I need it to just stay empty.

=XLOOKUP(A8, Client_clientele, Client_Phone, "", 0)
=IF(A8<>"", XLOOKUP(A8, Client_clientele, Client_Email, "", 0), "")
 
Upvote 0
=XLOOKUP(A8, Client_clientele, Client_Phone, "", 0)
If the above formula generates right results when Client name in Column A exists

then you can use

Excel Formula:
=IFERROR(XLOOKUP(A8, Client_clientele, Client_Phone, "", 0),"")
 
Upvote 0
If the above formula generates right results when Client name in Column A exists

then you can use

Excel Formula:
=IFERROR(XLOOKUP(A8, Client_clientele, Client_Phone, "", 0),"")
That worked perfectly! Thank you for helping solve this minor problem in a timely matter.
 
Upvote 0
I'm sorry Sanjay,

After doing some further testing, I still continue to get the same error.
 
Upvote 0
After doing some further testing, I still continue to get the same error.
No Problem

Share the XL2BB of actual data to understand the issue...

Also, need to understand the three lists you mentioned - Are the part of same table or how do they exist...
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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