+ Reply to Thread
Results 1 to 9 of 9

Nested IFs

Hybrid View

  1. #1
    Registered User
    Join Date
    12-14-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Nested IFs

    I would like to have excel look at column b and return the values in column a if there is a value in column b.

    Here is what started with, but I am very new at excel.

    =IF(ISTEXT(Schedule!B12),Schedule!A12,(IF(ISTEXT(Schedule!B16),Schedule!A16)))

    I am trying to do this for 8 rows and only want it to populate if there is a value in column B

    I can get it to populate with blanks, but I would like it only to populate when there is a value.

    Thanks in advance.
    Last edited by padadof2; 01-06-2010 at 02:40 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: nested what ifs

    So you are looking first at B12 and if there is something, you want A12, else you want to look at B16 and if there is something, then A16, else leave it blank?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    12-14-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: nested what ifs

    I would like it to look at a15 then b 16 then c 16, etc....then only populate if there is a value.

    I have attached the spreadsheet, so you can see what I am trying to do.

    I want to learn how to do it, but this is a little over my head.

    Thanks a lot for looking at this.
    Attached Files Attached Files

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Nested IFs

    1) I converted all the "totals" into normal decimal values since 9 times out of 10 that's the way they need to be evaluated. So instead of 7:30:00 for a total hours, it now reads normally as 7.5 hours.

    2) I added a set of "key index" columns off to the right of the schedule. These formulas flag specific rows for each day of the week and do it in a way that doesn't require heavy array formulas on all your daily sheets. The simple numbering system allows the names and times to be taken directly from the schedule in a simple way.

    These columns can be hidden if desired.

    3) All the day sheets now have an index in column A and the values matching the KEY columns from the schedule make it easy to INDEX/MATCH them over onto each sheet.

    This should be very robust for you.
    Attached Files Attached Files
    Last edited by JBeaucaire; 01-05-2010 at 05:56 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Nested IFs

    Please download the sheet again, I've edited it to include the hidden rows on the Schedule I didn't notice the first time.

    1:56 PM also added some automation at the top of the schedule so you only need enter the starting date.
    Last edited by JBeaucaire; 01-05-2010 at 05:57 PM.

  6. #6
    Registered User
    Join Date
    12-14-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Nested IFs

    this is GREAT! thanks a bunch! This is exactly what I was looking for. I am still trying to get my head around the keys on the side and how they work. This is definately solved, but I am just hoping to understand how it worked. Thanks again!

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Nested IFs

    This formula in L12:
    =IF(AND(ISNUMBER(B12),ISTEXT($A12)),L11+1,L11)

    ...makes the following requirements to increment:

    1) B12 must have a number in it (it is blank, so this formula will fail and remain zero)
    2) $A12 must have a text in it (Has "Mike" so this works)
    3) If 1 & 2 are both true, then L12 will look up to L11 and add 1. If not, it reflects the value in L11 again.

    So, only the first row of 4-row group can increment because I've removed the extra text from column A and there is only text in the first row of each group. (notice I took out the word "total"?).

    The indexes on the various pages are matching the first instance of each index number on the schedule in the appropriate key column to the index in column A of the daily sheet. This simple match makes it easy to find the row of data to display on each line.
    =========
    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)
    Last edited by JBeaucaire; 01-06-2010 at 01:09 PM.

  8. #8
    Registered User
    Join Date
    12-14-2009
    Location
    PA
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Nested IFs

    That was a little over my head, but I do see what you were doing. Hows the weather out there in BK? I have family in Kernville, go there often!

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Nested IFs

    Hehe...weather here is always great...gotta love So. California!

    My wife is from PA. Small world...

+ 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