Only first part of nested IF formula is working

centurymantra

New Member
Joined
Jan 30, 2017
Messages
26
I am using a nested IF formula as such:

=IF(A1="7eng.com","7G Enterprises LLC",if(a1=”a4gov.org”,”City of Ann Green”,if(a1=”abonaire.com”,”Abonaire Consultants”,” “)))

Dragging this formula down the column, it will work and populate a cell with "7G Enterprises, LLC" if it meets the first criteria, but just gives me a #NAME? error for anything else.

Can someone tell me what is missing from this formula?

Thanks!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
=IF(A1="7eng.com","7G Enterprises LLC",if(a1=a4gov.org,City of Ann Green,if(a1=abonaire.com,Abonaire Consultants,” “)))

Hi, the red slanted quotes do not look correct - try replacing (retyping) them with normal quote marks "
 
Last edited:
Upvote 0
Aha. This is a really subtle one - the answer is that in the rest of your formula, open and close quotes appear rather than double quotes - excel is remarkably picky about this sort of thing. Try:

=IF(A1="7eng.com","7G Enterprises LLC",IF(A1="a4gov.org","City of Ann Green",IF(A1="abonaire.com","Abonaire Consultants"," ")))

Cheers, John
 
Upvote 0
Hi, the red slanted quotes do not look correct - try replacing (retyping) them with normal quote marks "

Interesting. That was the issue. I was typing the formula in Word and it displays quotation marks like that when in brackets. Any way to stop Word from doing that? This formula is going to have about 40 nested ifs and I'd prefer not having to go through and do this if possible.
 
Upvote 0
Yes. In word options select proofing, then 'autocorrect options' then 'autoformat as you type' and remove the tick box next to 'straight quotes with smart quotes'. (the detail may be different depending on which word you are using - this is ok for word 2007. (I know - dinosaur but it works for me!).
 
Last edited:
Upvote 0
This formula is going to have about 40 nested ifs

Hi, it sounds to me like you would be better of using a lookup table and a VLOOKUP() formula - much easier to write, maintain and troubleshoot. For example:


Excel 2013/2016
ABCDE
1a4gov.orgCity of Ann GreenLookupReturn
27end.com7G Enterprises LLC
3a4gov.orgCity of Ann Green
4abonaire.comAbonaire Consultants
Sheet1
Cell Formulas
RangeFormula
B1=VLOOKUP(A1,D1:E4,2,0)
 
Upvote 0
Hi, it sounds to me like you would be better of using a lookup table and a VLOOKUP() formula - much easier to write, maintain and troubleshoot. For example:

Excel 2013/2016
ABCDE
1a4gov.orgCity of Ann GreenLookupReturn
27end.com7G Enterprises LLC
3a4gov.orgCity of Ann Green
4abonaire.comAbonaire Consultants

<colgroup><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B1=VLOOKUP(A1,D1:E4,2,0)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Yes...definitely. I was talking with someone else here at work and this was brought up. Thanks for the tip!
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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