Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2014, 09:01 AM
micro44 micro44 is offline Microsoft Word IF statement issues Windows 7 32bit Microsoft Word IF statement issues Office 2013
Novice
Microsoft Word IF statement issues
 
Join Date: Oct 2014
Posts: 3
micro44 is on a distinguished road
Default Microsoft Word IF statement issues

Hi! I have looked all over for an answer to this so I apologize if it has been answered elsewhere.

I am trying to create a nested if statement in a Word table based on a drop down box in one of the table's cells.



Cell B2: Drop box (High, Medium, Low)
Cell B3: Any numerical value (We can use 100 for the example)
Cell B4: If formula

I have (successfully!) created this formula in excel, but I can't seem to get it right in Word. Instead of posting my terrible attempts in Word I have included the Excel formula below. Could someone please help me with the proper Word formula???

=IF(B2="High",B3/(1+B3*0.2^2),IF(B2="Medium",B3/(1+B3*0.1^2),IF(B2="Low",B6/(1+B6*0.05^2),"FALSE")))
Reply With Quote
  #2  
Old 10-22-2014, 03:30 PM
macropod's Avatar
macropod macropod is offline Microsoft Word IF statement issues Windows 7 64bit Microsoft Word IF statement issues 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

The main problem you'll have trying to do this in Word is that Word's table referencing formulae don't recognise text. Consequently, they can't test for 'High', 'Medium', or 'Low'. If your drop down box is a formfield dropdown in a document with forms protection applied, though (but not a content control dropdown), this is not an impediment. Assuming you are working with a formfield dropdown, the field code to do the calculation in Word is:
{IF{REF Dropdown1}= "High" {=B3/(1+B3*0.2^2)} {IF{REF Dropdown1}= "Medium" {=B3/(1+B3*0.1^2)} {IF{REF Dropdown1}= "Low" {=B3/(1+B3*0.05^2)} "FALSE"}}}
where Dropdown1 is the formfield dropdown's internal bookmark name and you set it's 'calculate on exit' property.

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practicable to add them via any of the standard Word dialogues. The spaces represented in the field construction are all required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-23-2014, 06:09 AM
micro44 micro44 is offline Microsoft Word IF statement issues Windows 7 32bit Microsoft Word IF statement issues Office 2013
Novice
Microsoft Word IF statement issues
 
Join Date: Oct 2014
Posts: 3
micro44 is on a distinguished road
Default

Thank you for the response!

I still seem to be having some trouble (shocking!)...

1) I was using a content control dropdown, so I have switched that to the form field. The data in cell B3 can vary and I need to be able to change the input. Is there a way to allow that cell to be edited after protection is enforced?

2) After the formula, dropbox, and cell B3 are all correct. What is the best way to re-run the formula when one or more of the inputs get changed? Is this supposed to be automatic?

3) Finally, I am not sure if I have something incorrect with my formula. It spit out a number the first time, but when I tried to run it again I got a syntax error. I have attached a shot of the formula.


I would really appreciate any more assistance you could provide. Thank you so much for your help!
Attached Images
File Type: png Formula.PNG (13.7 KB, 53 views)
Reply With Quote
  #4  
Old 10-23-2014, 06:13 AM
micro44 micro44 is offline Microsoft Word IF statement issues Windows 7 32bit Microsoft Word IF statement issues Office 2013
Novice
Microsoft Word IF statement issues
 
Join Date: Oct 2014
Posts: 3
micro44 is on a distinguished road
Default

Actually, the formula seems to be working well now.

So my only issues relate to #1 and #2 above.

Thanks
Reply With Quote
  #5  
Old 10-23-2014, 12:10 PM
macropod's Avatar
macropod macropod is offline Microsoft Word IF statement issues Windows 7 64bit Microsoft Word IF statement issues 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

For #1, you can use a text formfield. As with the dropdown formfield, you should set it's 'calculate on exit' property.

For #2, setting the 'calculate on exit' property will take care of any updates.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft office 2010 professional plus 64 bit launching issues kmg Office 1 11-16-2013 05:56 AM
Help with IF statement in word 2010 Mad Word 2 04-06-2013 06:31 AM
Combining Multiple Word Documents Heading/Figure Issues Word 2007 grantgibson45 Word 1 09-10-2012 11:00 PM
Microsoft Word IF statement issues Issues with Microsoft Word Form Fields hbforsyth Word 9 11-14-2011 04:26 PM
Issues with synchronization log causing send/receive issues WinSock64 Outlook 0 01-11-2011 11:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:31 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