Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-28-2016, 07:22 PM
Warren99 Warren99 is offline Error in If statements Windows XP Error in If statements Office 2016
Novice
Error in If statements
 
Join Date: May 2016
Posts: 10
Warren99 is on a distinguished road
Default Error in If statements

=IF(J18=76,P18*13),IF(J18=89,P18*20)

The above function returns #Value!


What am I doing wrong?
Reply With Quote
  #2  
Old 05-28-2016, 09:59 PM
macropod's Avatar
macropod macropod is offline Error in If statements Windows 7 64bit Error in If statements Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Your formula isn't valid. Try:
=IF(J18=76,13,IF(J18=89,20,0))*P18
You need to provide an 'else' result for cases where J18 isn't either 76 or 89. I've put a 0 in the formula where that should go.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-28-2016, 10:22 PM
Kevin@Radstock Kevin@Radstock is offline Error in If statements Windows 10 Error in If statements Office 2016
Office 365
 
Join Date: Feb 2012
Posts: 94
Kevin@Radstock is on a distinguished road
Default

Hi

As you have Excel 2016, use the IFS function.

=IFS(J18=76,P18*13,J18=89,P18*20)
Reply With Quote
  #4  
Old 05-29-2016, 01:51 AM
Warren99 Warren99 is offline Error in If statements Windows XP Error in If statements Office 2016
Novice
Error in If statements
 
Join Date: May 2016
Posts: 10
Warren99 is on a distinguished road
Default

I tried this but it came up with a #NAME? error which would indicate I do not have Excel 2016. Thank you for your help. The previous solution worked so all is well.
Reply With Quote
  #5  
Old 05-29-2016, 01:54 AM
Warren99 Warren99 is offline Error in If statements Windows XP Error in If statements Office 2016
Novice
Error in If statements
 
Join Date: May 2016
Posts: 10
Warren99 is on a distinguished road
Default

Thank you Paul that worked. What is the zero for again?
Reply With Quote
  #6  
Old 05-29-2016, 02:01 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Error in If statements Windows 7 64bit Error in If statements Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Quote:
Originally Posted by Warren99 View Post
I tried this but it came up with a #NAME? error which would indicate I do not have Excel 2016.

OTH you indicate in your data that you use Office2016??

The 0 is the result if J18 is not equal to 76 nor 89
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #7  
Old 05-29-2016, 04:04 AM
Warren99 Warren99 is offline Error in If statements Windows XP Error in If statements Office 2016
Novice
Error in If statements
 
Join Date: May 2016
Posts: 10
Warren99 is on a distinguished road
Default

Thank you for your help.
Reply With Quote
  #8  
Old 05-29-2016, 04:10 AM
Warren99 Warren99 is offline Error in If statements Windows XP Error in If statements Office 2016
Novice
Error in If statements
 
Join Date: May 2016
Posts: 10
Warren99 is on a distinguished road
Default

I do have but there must be some other glitch. I have sorted out the problem but thanks for your help.
Reply With Quote
  #9  
Old 05-29-2016, 01:59 PM
Kevin@Radstock Kevin@Radstock is offline Error in If statements Windows 10 Error in If statements Office 2016
Office 365
 
Join Date: Feb 2012
Posts: 94
Kevin@Radstock is on a distinguished road
Default

Quote:
Originally Posted by Warren99 View Post
I tried this but it came up with a #NAME? error which would indicate I do not have Excel 2016. Thank you for your help. The previous solution worked so all is well.
Then correct the version of office you are using and not misleading people.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in If statements Help with if then statements brent chadwick Word VBA 35 07-25-2015 02:41 PM
Error in If statements Using IF statements stuwoolf Excel 2 01-10-2015 01:58 PM
Error in If statements count if statements Alaska1 Excel 1 05-14-2014 08:21 AM
Multiple If statements bremen22 Excel 2 10-15-2013 06:37 AM
IF statements that shifts to right. kent Excel 0 01-19-2006 02:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft