Microsoft Office Forums Can you do True or False equations in Excel?
 Register FAQ Search Today's Posts Mark Forums Read

#1
02-05-2016, 09:26 AM
 WisCowboy Windows XP Office 2010 32bit Novice Join Date: Feb 2016 Posts: 1
Can you do True or False equations in Excel?

Hello everyone.

I'm currently working up a program at work on Excel 2010 for the medical field. I'm trying to make the equation for drugs to be used from written orders. However, we typically work in milligrams but sometimes drugs are in Micrograms, Nanograms, Grams, and even Grains. The cell I'm having problems with; I'm trying to make it a True = (the drug is in milligrams then move to the next part of the equation) or False = (the drug is in a different concentration so take the number from cell #X and times or divide it by #N to put that result into the next part of the equation).

This also leaves me another potential problem too. Depending on if this requires more then one cell to complete, can I make an equation that states something to the following, (Take either # from cell X OR # from cell Y and then times it by cell Z)?

I was trying to use the =IF function but not sure if that is the right one to use. So far what I've put in, always comes back as an error. I'm hoping the solution will be an easy command and doesn't require to make someone rack their brain too hard. Thanks for the assistance.
#2
02-05-2016, 04:53 PM
 macropod Windows 7 64bit Office 2010 32bit Administrator Join Date: Dec 2010 Location: Canberra, Australia Posts: 19,525

Excel's IF function certainly does TRUE/FALSE processing, and this can be combined with AND & OR functions, etc., as well as being nested. For example:

=IF(A1="milligrams",TRUE,FALSE)
=IF(A1="milligrams",B1,IF(A1="micrograms",B1*1000, 0))

If you want something more specific, you'll need to provide further details. It would also be helpful if you could attach a worksheet to a post with some representative data (delete anything sensitive). You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post Cosmo PowerPoint 14 11-03-2013 01:21 AM jdove78 Project 2 10-10-2012 05:53 PM peterv Word 5 07-19-2012 02:11 AM danellekent Mail Merge 1 04-27-2012 02:19 AM oluc Word VBA 4 11-21-2010 08:10 AM

All times are GMT -7. The time now is 10:38 PM.

 -- Default Style -- Lightweight -- New Mobile Contact Us - Privacy Statement - Top