3

Changing this Excel formula to include 'OR'

 3 years ago
source link: https://www.codesd.com/item/changing-this-excel-formula-to-include-or.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Changing this Excel formula to include 'OR'

advertisements

I need to change this Excel formula by including the OR statement in it.

Actually it stands like this:

=IF(D18=0,"NA",(D17-D18)/D18))

I need it to become:

IF D18=0 OR D18="NA", THEN "NA", ELSE (D17-D18)/D18


Try this:

=IF(OR(D18=0,D18="NA"),"NA",(D17-D18)/D18)

In Excel, you use OR and AND as functions like above, instead of doing something like x=A OR x=B as is done in most programming languages.

Related Articles

How do I convert this Excel formula to VBA code?

'I am using this formula in an Excel worksheet, in cell A6. It is working fine. =IF(O6="Hand","Manual Entry",IF(O6="JET",R6,IF(O6="COKE","Red Bull",IF(O6="Freight","Logistics",IF(O6=&qu

How to drag and drop the Excel formula to include cells at specified intervals

I have an Excel sheet in which I want start column D with the following formula: =AVERAGE(C7:C10) I want to be able to drag down column D to give the following formulae: =AVERAGE(C11:C14) =AVERAGE(C15:C18) =AVERAGE(C19:C22) etc. However, if I just na

Why does this Excel formula work?

In this answer the following formula is given. {=PERCENTILE(IF(COLUMN(INDIRECT("1:"&MAX(Data!N3:N15)))<=Data!N3:N15,Data!M3:M15,""),0.25)} It is supposed to calculate the first quartile of data with weights. I've been trying to

What is the fastest way to boost the performance of this Excel formula?

This is to go further from the following post. How to overcome the max length limit of a formula in Excel? a bug of excel? Here is a problem I am trying to solve. Given a data set with categories and values category value1 value2 a 1.0 ... a 2.0 a 1.

What's wrong with this Excel formula?

I have this formula =IF(G6="", "", CONCATENATE("[",INDIRECT(G6),"]","Sheet1","!$A1")). It is reading excel file name from column G6, and then it read Column A from Sheet1. This give invalid Cell

What does this Excel formula do?

Can someone please explain in English wtf this formula is doing? I'm looking at someone else's work and have no idea. =SUM(OFFSET(INDIRECT((ADDRESS(ROW(),21)),0,0,1)CurrentActualPeriod)) Agreeing with jeffreymb, you can also use the Evaluate Formula

How to add a third criterion to this Excel formula?

Here is the formula I am using: {=INDEX(AA$1:AJ$1831,MATCH(1,(AA$1:AA$1831=C2)*(AD$1:AD$1831=O2),0),10)} It finds a number based on matching a name and hour of day. I need to refine this to also match day of week. The problem I am running into is tha

CakePHP: How do I change this search call to include all records that do not exist in the associated table?

I have a few tables with the following relationships: Company hasMany Jobs, Employees, and Trucks, Users I've got all my foreign keys set up properly, along with the tables' Models, Controllers, and Views. Originally, the Jobs table had a boolean fie

Do not understand the Excel formula built into VBA

Can someone please explain this Excel formula inside the VBA code. Range("U8").FormulaR1C1 = _ =IF(ISNA(VLOOKUP(RC[-1],'C:\temp\MasterRecords.xls'!C2:C15,14,FALSE)=""True""),""No Title Found"",VLOOKUP(RC[-

Change the variable horizontally in the excel formula

I want to change a variable in an excel formula horizontally and maintain one variable constant. O3/$C18, P3/$C18, Q3/$C18 I can keep the the bottom variable constant by using the $ symbol but when I want to extend the formula to additional cells, th

What is the best way in the Excel formula to parse this string?

I have a column of data and each cell has something like: Last First (Id) such as : Thompson Joe (ABC12323) and i want to parse out the: ABC12323 NOTE: in some rare cases I see there are two ids listed like this: Thompson Joe (ABC12323) (DEF1123432)

Excel Formula & amp; metadata

Is there any way to extract underlying metadata of various excel formulas. I am building this framework in C# that uses excel formula, and interested in knowing each formula input arguments, their data types and return type. This will help me to buil

How can I produce a standard Excel formula following a query?

I have a large and complicated Excel query, which works as desired. However, I'm implementing some real-time data-validation features (i.e. not requiring a data refresh), and I need to have a regular excel formula in one of the columns of my query re

Use a Variable in an Excel Formula

Is it possible to use a specific cell as a variable in an excel formula so whatever value is in that cell will be inserted to the formula? For example: =SUM(B1:B100) I want to use cell A2 as my holder, so I insert the end figure there A2 = 95. How do

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK