+ Reply to Thread
Results 1 to 11 of 11

specifying cel contents range in embedded if Statement

  1. #1
    Registered User
    Join Date
    04-30-2010
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    specifying cel contents range in embedded if Statement

    trying to figure out how to specify a range in mt if statements.AG6 is my linked "control" cell for a combobox. cant seem to specify if it is i.e."2 OR 4". I just used the word "OR" in the code as an example of where i need to "OR" at.

    Please Login or Register  to view this content.
    Or here i cant specify a range like you normally do with a cell range using ":"
    Here i am needing 2 through 4 or any size range for that matter.
    Please Login or Register  to view this content.
    any help would be greatly appreciated. thanx in advance
    Last edited by fuston05; 05-04-2010 at 08:18 AM.

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: specifying cel contents range in embedded if Statement

    I'm probably missing something but will
    IF(or(AG6=2,AG6=4),AA16*1.25,"")
    do the trick?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    04-30-2010
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: specifying cel contents range in embedded if Statement

    yea, but i was hoping for a way to simplify it because im going thru like a ton of possible combinations between 2 cells. like a PHP Case: or switch: heres what i have to check all the possible combinations. need a simple way to do the same:

    =IF(OR(AND(AG6=2,AG24=2),AND(AG6=2,AG24=4),AND(AG6=3,AG24=2),AND(AG6=3,AG24=4),AND(AG6=4,AG24=4),AND(AG6=4,AG24=2)),AA6*0.25,IF(OR(AND(AG6=2,AG24=3),AND(AG6=2,AG24=5)),AA6*1.25,IF(OR(AND(AG6=3,AG24=3),AND(AG6=3,AG24=5)),AA6*0.4,IF(OR(AND(AG6=4,AG24=3),AND(AG6=4,AG24=5)),AA6*0.75))))
    Im a php, and python guy usually, so this is a lil new to me.
    Last edited by fuston05; 05-03-2010 at 08:22 AM.

  4. #4
    Registered User
    Join Date
    04-30-2010
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: specifying cel contents range in embedded if Statement

    my previous code posted works perfectly, but its just so darn long..lol

  5. #5
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: specifying cel contents range in embedded if Statement

    maybe
    Please Login or Register  to view this content.
    Last edited by pike; 05-03-2010 at 08:37 AM.

  6. #6
    Registered User
    Join Date
    04-30-2010
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: specifying cel contents range in embedded if Statement

    yea, that looks good...it was right in front of my face the whole time..lol thank you very much.

  7. #7
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: specifying cel contents range in embedded if Statement

    Hi fuston05
    better test it first
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-30-2010
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: specifying cel contents range in embedded if Statement

    Yea, just verified.. this does work perfectly, and is much shorter code:

    Please Login or Register  to view this content.
    Thank you very much for helping out, much appreciated.

  9. #9
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: specifying cel contents range in embedded if Statement

    your welcome & thanks for posting in the forum?

    Dont forget to mark the post solved to help other searching for answers

  10. #10
    Registered User
    Join Date
    04-30-2010
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: specifying cel contents range in embedded if Statement

    How do I mark it as "solved"?

  11. #11
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: specifying cel contents range in embedded if Statement

    Hi
    Go the your very first thead and click "edit"
    then click the "go advance" button
    sroll up to the top combobox and select "SOLVED" and saved

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1