IF function within an IF function?

How can I nest an IF function within an IF function?

What I have now:

=IF(G5<G6,"A","B")

What I would like:

IF G5 <= G6
THEN    IF J5 < J6, "A", "B"  
ELSE   "B"

If the the first 2 comparisons are equal, I want it to
evaluate different cell

--
Message posted from http://www.ExcelForum.com

0
5/6/2004 10:20:28 AM
excel.misc 78881 articles. 5 followers. Follow

5 Replies
691 Views

Similar Articles

[PageSpeed] 7

=IF (G5 <= G6,IF(J5 < J6, "A", "B" ),"B") should do it for 
you.

Hope this helps

Paul Falla
>-----Original Message-----
>How can I nest an IF function within an IF function?
>
>What I have now:
>
>=IF(G5<G6,"A","B")
>
>What I would like:
>
>IF G5 <= G6
>THEN    IF J5 < J6, "A", "B"  
>ELSE   "B"
>
>If the the first 2 comparisons are equal, I want it to
>evaluate different cells
>
>
>---
>Message posted from http://www.ExcelForum.com/
>
>.
>
0
paul_falla (99)
5/6/2004 10:51:33 AM
Hi,

Try:
=IF(G5<=G6,IF(J5<J6,"A","B"),"B")
or, better still:
=IF(AND(G5<=G6,J5<J6),"A","B")

Cheers


"picktr >" <<picktr.15txs2@excelforum-nospam.com> wrote in message
news:picktr.15txs2@excelforum-nospam.com...
> How can I nest an IF function within an IF function?
>
> What I have now:
>
> =IF(G5<G6,"A","B")
>
> What I would like:
>
> IF G5 <= G6
> THEN    IF J5 < J6, "A", "B"
> ELSE   "B"
>
> If the the first 2 comparisons are equal, I want it to
> evaluate different cells
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.676 / Virus Database: 438 - Release Date: 3/05/2004


0
5/6/2004 10:53:54 AM
H,I  are hidden

E                      F              G               J

5          Jeff 	      B	    10	     10	
6        Steve  	      B	    10	      9	


Both formulas are returning B

The result should be      Jeff       B
Steve    

--
Message posted from http://www.ExcelForum.com

0
5/6/2004 1:45:29 PM
That's not what you asked for, the conditions you stated with

G5<G6 i.e. 10 is not less than 10 so that is FALSE
 J5<J6    i.e. 10 is not less than 9 so that is also FALSE

-- 

Regards,

Peo Sjoblom


"picktr >" <<picktr.15u79p@excelforum-nospam.com> wrote in message
news:picktr.15u79p@excelforum-nospam.com...
> H,I  are hidden
>
> E                      F              G               J
>
> 5          Jeff       B     10      10
> 6        Steve        B     10       9
>
>
> Both formulas are returning B
>
> The result should be      Jeff       B
> Steve    A
>
>
> ---
> Message posted from http://www.ExcelForum.com/
>


0
terre08 (1112)
5/6/2004 2:32:20 PM
Peo,

Than how do I correct it?
( F )               ( G )        
( J )
row5          Jeff 	     ( B )	      (10)	    (10)	
row6	Steve            ( A )           (10)          (10)

I want the first evaluation to be from the first column of numbers
in column G

If both are = than it should look at the second column of numbers
in column J, then perform the function

If it were just the first column of numbers, that is easy

--
Message posted from http://www.ExcelForum.com

0
5/6/2004 3:02:39 PM
Reply:

Similar Artilces:

Excel hyperlinks
I have tried using nested functions in a hyperlink to another cell on different worksheet but keep getting the error that the specific fil cannot be found. Is it possible to use hypelink function with a nested function. I'm trying to lookup a value in cell A1 on a second sheet in the column and return the cell location so I can create a hyperlink to it. Please help. Thank -- Message posted from http://www.ExcelForum.com Rusty - In stead of a hyperlink, you could use a macro that uses If-Then or Select Case to go to another sheet or whatever, much as a hyperlink would. Trigger th...

Function problems
I need to create a formula that can update when new entries and entered in the rows of a single page spreadsheet. Here is the problem. This is a standardized format for my office so all I can do is fix their equation. The prior year numbers are on the 2nd row of the spreadsheet, and they enter new entires in successive rows on the form so that they can track staff strength numbers on a weekly basis for the entire year. They want an equation that will recompute the weekly comparison to the prior year's ttl number. I can't just use SUM because we're not tracking growth. W...

CoCreateInstance function returns NULL
Hi All, I'm trying to access some classes than an OLE server expose, I know the CLSID of such classes because they are placed in Windows Registry. I use the : STDAPI CoCreateInstance( REFCLSID rclsid, //Class identifier LPUNKNOWN pUnkOuter, //Object is or isn't part of an aggregate DWORD dwClsContext, //Context for running executable code REFIID riid, //Interface identifier LPVOID * ppv //Pointer to storage of interface pointer ); This is the program I use in Borland C++ 5 to instance a class LPVOID ppv; CLSID pclsidobjeto={0x12345678, 0x1234, 0x1234,0x1234,0...

Sort function for dates not working properly
I have a column with mm/dd/yy formatted for dates. When I sort by that column, it will sort by Jan-Dec 2004, then Jan-Dec 2003. I want it to do it by Jan 2004-Dec2003...how can I do this? Kayden, Excel will always use the year then the month to sort by dates. To sort by month ONLY, I would create another column and use the =MONTH() formula that extracts the month from your column of dates. After that, you can use this new column to sort using only the month. HTH Eric Hi Kayden If I got that right your result after sorting is, that you'll get the year descending and the month...

how do i reference multiple rows/columns with one function?
I'm trying to reference multiple columns/rows on one worksheet to summarize in another. Can I do this with one function? Can I add a row or column on the original sheet later and have it ripple through to the other page? You can do this a number of simple ways... Each sheet can have your data in a standard format (say for regions - each sheet would have that regions numbers in it) and have a summary sheet that references all of the other sheets - if they are formated the same, it is as simple as entering the = sign in the summary cell, and then selecting the cell in each sheet you wa...

Specify BOLD within a formula?
Hi, I have a formula which looks up 2 text strings (at least part of them) and concatenates them. Is there any way to have the second text string display in BOLD by somehow specifying this within the formula? =LEFT(VLOOKUP(B12,Derivative,4,FALSE),FIND("(",VLOOKUP(B12,Derivative,4,FALSE),1)-2)&" - "&LEFT(VLOOKUP(C12,Derivative,4,FALSE),FIND("(",VLOOKUP(C12,Derivative,4,FALSE),1)-2) I want the second LEFT(VLOOKUP... to be in bold. Any help greatly appreciated, Rgds Jason No, a formula cannot affect the formatting - only a result. Sorry, Pe...

OL hangs when performing any function.
When I open ol and try to send mail or any other function OL hangs an can only be closed using Ctrl Alt Del. I can ping all parties in th email chain fine. This appears to have happened after rnning ADWare Any ideas ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages directly from http://www.ExcelForum.com PS I am running outlook 2000. When I finally close OL I have a messag that WMS is Running ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet me...

Charttiltle as function
I have programmed a macro that makes a pivottable and a pivotdiagram. In this diagram I have a charttitle that I want to be equal to the content of one cell (D2). So if the content of the cell changes, I want the Charttitle also to change. Manually I can do this by selecting the charttitle and use the function (=D2) on the top of the excel-sheet. But this will not work when I try the recorder. Can anyone help? Are you running the macro each time the chart title changes? Barb Reinhardt "Trond" wrote: > I have programmed a macro that makes a pivottable...

Case function
Does Excel have a function similar to the "Case" command in other programming languages? In VBA, yes Select Case myVal Case 1: 'do something Case 2: 'do something else Case Else; ' exception End Select -- HTH RP (remove nothere from the email address if mailing direct) "Al" <Al@discussions.microsoft.com> wrote in message news:F99619C8-E32C-4B61-9C81-5663E8CE879C@microsoft.com... > Does Excel have a function similar to the "Case" command in other programming > languages? XL itself doesn't, si...

right, mid, left functions??
I have a column with STATE & CITY information i.e. A1= VIRGINIA BEACH VA, A2=YAKIMA WA, A3=RENO NV, etc. I'm able to extract the STATE digits using the 'right' function; however, I can't do the same for the CITY information due to the different lenghts. Is there a formula to do this? Please help. Hi, Try this =TRIM(LEFT(A1,LEN(A1)-2)) -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "syl_usmc" wrote: > I have a...

Assertion Error at the end of main() function
I used the Wizard to create a "Hello World" Console 32 app. I then set the project to use MFC and am using the DAO classes. It compiles ok. It runs ok until the main() function is done executing. In the debugger, it gets to the right curly brace (}) signifying the end of main and then it gives an Assertion error in DAOCORE.CPP. I don't understand what's happening. Any ideas? Thank you. ...

VB UML model from function
Hy How can I build an uml model from a VB 6 function? Thanx 4 any help There is no support to create a UML model using a VB6 function It can however reverse-engineer a VB project into a UML diagram -- -ronnie [MS] This posting is provided "AS IS" with no warranties, and confers no rights. "Papp Gy�rgy" <pappgyorgy@digicart.hu> wrote in message news:eEG6bJQeDHA.1716@TK2MSFTNGP10.phx.gbl... > Hy > > How can I build an uml model from a VB 6 function? > > Thanx 4 any help > > ...

problem using excel function in vba
Hi I have just been working on vba for the last 2 days only so please pardon my lack of understanding of even the very basic terms Basically, I have made an excel sheet where I have automated a process of copying a specific range of rows from sheet 1 to different sheets using for loop. everytime the loop finishes, it moves onto the next column to copy the values again. This goes on when I press the start timer button Ideally what I want to do is when I press the stop timer button, my code should automatically move onto the next column and do a calculation (variance) of al...

Need help with excel functions retrieving data
I hope someone may be able to help me out... I have a spreadsheet that is an output of all computers on our network and what applications are installed on them The spreadsheet is organized by all computer names listed in column A, and all software listed in column B. So, in column A, you will see multiple entries for each computer and in column B, you will see a different software name in each of the rows next to the computer name in column A. On another sheet, I would like to be able to choose from a dropdown list of computer names (grabbed from column A) and have it display all the softw...

Macro to turn on "Track Changes" function
I'm trying to create a macro that turns on the "Track Changes" function with a shortcut key. The problem is that while I'm recording the macro the traditional way, the recording process stops when the "Track Changes" function is turned on. Is there a way to overcome this problem or is the "Track Changes" function not possible to put into a macro, even in Visual Basic? ...

Need to alphabetize data from separate cells within same row
Hi there, I have a worksheet with 6,500 rows of data. In each row, there are up to 6 cells containing a name in "Last, First" format. I need to alphabetize the data from these 6 cells so they go across the row in order left to right, alpha by last name. Example of my data layout: Column 1 Column 2 Column 3 Row 1 Jackson, Bob Anderson, Lisa Cardinal, Mike Row 2 Tomlinson, Steve Dodge, Sarah White, Brian I need them to be in this order: Column 1...

problem trying to make a "FitAll" function to a ScrollView
Hi, I'm developing an application where the user is applying filters to an image. I have to display on the left side the original image and on the right side, the modified image. I have an MDI application with a ScrollView derived view. The image are draw in the view like that : BBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBOOOOOOOOOOOBBBFFFFFFFFFFF BBBOOOOOOOOOOOBBBFFFFFFFFFFF BBBOOOOOOOOOOOBBBFFFFFFFFFFF BBBOOOOOOOOOOOBBBFFFFFFFFFFF BBBOOOOOOOOOOOBBBFFFFFFFFFFF BBBOOOOOOOOOOOBBBFFFFFFFFFFF BBBOOOOOOOOOOOBBBFFFFFFFFFFF where B is a border (set to 5 ) OOO : original image FFF : filtered image As membe...

what api or function to use to check if blank CD is in the CDROM drive??
What api or function to use to check if new blank CD-RW is in the CDROM drive?? GetDriveType() only gives you info about the type of drives on your computer nothing on whether a diskette or CD is in your drive. Lets say d: is your cd-rom drive and you try SetCurrentDirectory(d:\) it will always fail for a new blank cd inserted into your CD-RW drive. How to check if blank CD is in the CDROM drive?? Using DeviceIoControl function with IOCTL_STORAGE_CHECK_VERIFY to determine if media is in drive. ngsteve@my-deja.com (Steve) wrote in message news:<976e0586.0405242248.355c055a@posting.google.c...

M/S Excel: How to activate formula displaying function
Does anybody know how to display the formula (or text) displaying "cell", usually displayed at the bottom of tool bars in M/S Excel? Note that I am note referring to the formula display window. It was working in the beginning, but I imagine that for mistake this function was turn off in my laptop. Thank you very much in advance. JF On the View menu - Formula Bar -- Jim Rech Excel MVP Hi JF I think this is what you are asking about View>Formula_Bar (on the pulldown menu Good Luck Mark Graesse mark_graesser@yahoo.co Boston M ----- JF wrote: ---- Does a...

Text Columns Function
The data I am bringing in to Excel comes in two rows for a single record. I need to reformat it so that all of the data is on one line. As there are several thousand records, I need to do find a way to automate this. Any suggestions? -- KKD May be this... https://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.excel.worksheet.functions&mid=68c108bb-045d-40e5-9187-a5785baa67be&sloc=en-us -------------------- (Ms-Exl-Learner) -------------------- "KKD" wrote: > The data I am bringing in to Excel comes in two rows for a s...

can LOOKUP function compare text instead of numerical data?
As title. Can LOOKUP function compare text in cells instead of numerical data? Thanks much -- cheerboy555 ------------------------------------------------------------------------ cheerboy555's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=33989 View this thread: http://www.excelforum.com/showthread.php?threadid=539168 The answer is YES Regards, -- AP "cheerboy555" <cheerboy555.27bkso_1146807608.0087@excelforum-nospam.com> a �crit dans le message de news: cheerboy555.27bkso_1146807608.0087@excelforum-nospam.com... > > As title. >...

user defined function in query
I have created a function to return the windows user's full name (via Windows API calls). This function is run via a query and returns the name ok when I am in the data base. However when I try to run this query from a web page via a connection to the database, I get the message 'undefined function'. Is it impossible to run this type of query except locally? Yes, it is not possible to use the VBA function from outside Access. -- John Spencer Access MVP 2002-2005, 2007-2008 Center for Health Program Development and Management University of Maryland Baltimore County .. "...

Can I create a function in Excel?
I'm trying to build a function that takes few cells (including ranges), so that I can perform a calculation using those figures. I'd like to use this function several times performing the same kind of calculation but using different cells and ranges. Ideally I can create a function similar to the ones already built in Excel (like PV, sum, etc...). How can I do that? Thanks a lot. There are two ways to write your own functions for use in Excel. You can use the "Define Name" facility that is normally used to define a name for a cell or a range. It will also accept a s...

internal support function has returned an error
I have a user that has a subfolder to her contacts folder. When she goes to create a new email, chooses the To... button, and clicks the drop down box for address lists, it shows 2 instances of the subfolder. One works and the other returns an error. "An internal support function has returned an error". That is the only place in Outlook where the subfolder appears twice (shows normally in the services and folder list) Anyone have an idea of how to delete the non-working folder in a non-drastic way.. ie... re-installing. This is Win2k / OL 2k. thx ...

Strange name mangling in imported class function
Hi, I've run into a strange name mangling problem using VC++ 2005 and VC+ 2008. A given class function (example) virtual bool OnValueDecrement(CExtGridWnd & wndGrid, LONG nColNo,LONG nRowNo,INT nColType,INT nRowType); is being imported as ?OnValueDecrement@CExtGridCell@@UAE_NAAVCExtGridWnd@@JJHH@Z The third party DLL I'm using here exports this function as ?OnValueDecrement@CExtGridCell@@UAE_NXZ I suppose this is a compiler/switch issue. Any clues? >I've run into a strange name mangling problem using VC++ 2005 and VC+ 2008. >A given class function (example) >...