nested IF

SamS

Well-known Member
Joined
Feb 17, 2002
Messages
542
Having trouble putting together a nested IF statement, it all depends on whether the cell G8 is in error or not, probably a better way to do it. Here are the 2 formula I need nested:

=IF(AND(ISERROR(F8),ISERROR(G8)),E8+F11,#N/A)

=IF(AND(ISERROR(F8),NOT(ISERROR(G8))),E9+F11)

thnx
 
hotpepper - have tried to download the html maker but get a compile error - also your last messsage came through as all html.

I will work on it over the net day or so and repost, thanks for your help
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Read the FAQ "How to display your sheet on the board/HTML Maker FAQ" on the Main Excel question page, it tells you how to fix any errors you may come across and how to use it.

Check in your Profile and make sure Always Allow HTML is set to Yes.
 
Upvote 0
thanks hotpepper, profile was set to no for html - haven't looked at my profile for years - also had trouble uploading new profile - guess will have to spend more time on it. I still had trouble with formula in the format of


=IF(criteria 1,IF(criteria2,E8,E9)+F11,NA()) the second criteria of and(iserror(f8),iserror(g8) caused it to return #N/A.
Scratched around a bit and retried the old nested formula of
=IF(criteria1,True,if(criteria2,true,false) and it worked. Tried then massaging back to the previous formula and error again. Will have to play around with it so I can understand why it doesn't want to work except for the first criteria.
 
Upvote 0
If you can see my examples, that was the first one and it returned 15, not #N/A.

Do you have an #N/A in E8 or F11?

Why are you trying to go back to a formula that doesn't work?

Try the formula that Aladin posted.
 
Upvote 0
I think I see whats confusing me.
We have two variables with two conditions, so four possible outcomes. What we need is to know what you want the response to be for each of those four conditions.

Condition 1: f8=error, g8=error
Condition 2: f8=error, g8=NOT error
Condition 3: f8=NOT error, g8=error
Condition 4: f8=NOT error, g8=NOT error


So, what reply do you want for each condition?
Condition 1: e8+f11
Condition 2: e9+f11
Condition 3: ???
Condition 4: ???
 
Upvote 0
chowell45014, if conditions 3 & 4 are met then NA().

Hotpepper, Aladins formula was set for a single condition not as 450124 shows above. When I tried to insert the extra details condition 1 would work not condition 2. As mentioned have worked out the other formula and will try and see what I was doing wrong when trying to convert Aladins, suspect there is something wrong with my logig in applying the extra conditions.

Thanks for perservering with me

HP - Still can't seem to load up my profile so can't see your example, am=nother little problem for me to solve.
 
Upvote 0
=IF(ISERROR(F8),IF(ISERROR(G8),E8+F11,E9+F11),"#N/A")

Tested all four possibilities.

If both are errors, then E8+F11
If F is error and g is not, E9+f11
If e is not error then N/A

Hope it helps!
 
Upvote 0
=IF(ISERROR(F8),IF(ISERROR(G8),E8+F11,E9+F11),"#N/A")

Tested all four possibilities.

If both are errors, then E8+F11
If F is error and g is not, E9+f11
If e is not error then N/A

Hope it helps!

How does that differ from:

=IF(ISERROR(F8),IF(ISERROR(G8),E8,E9)+F11,NA())

which is already posted, except for repeating F11 twice and pondering a text-formatted #N/A?
 
Upvote 0
Hotpepper, Aladins formula was set for a single condition

Huh?

You confirmed that this was what you wanted:

To clarify:
If F8 is ERROR and G8 is Error then E8+F11
If F8 is ERROR and G8 is Not Error then E9+F11
Any other combination is #N/A

Aladin's formula meets all these criteria, as shown in the examples I posted.

You don't have to check for any other criteria, because if it didn't meet the first two conditions, it would use the ending FALSE argument, which is NA(), which would be any combination that are not the first two.


To change your profile, just click the Profile link at the top of the page, change the HTML option and click Submit
 
Upvote 0
Aladin, don't know why but this formula just doesn't want to work for me

=IF(ISERROR(F8),IF(ISERROR(G8),E8,E9)+F11,NA())

will try the variation hotpepper has suggested (got a football game on I want to watch) tomorrow.

HP - I change my profile hit submit and keep getting server cannot be found after about 1 minute.
 
Upvote 0

Forum statistics

Threads
1,226,224
Messages
6,189,733
Members
453,566
Latest member
ariestattle

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