+ Reply to Thread
Results 1 to 7 of 7

IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows

  1. #1
    Registered User
    Join Date
    04-16-2019
    Location
    South Dakota, United States
    MS-Off Ver
    2013
    Posts
    50

    IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows

    Good evening,

    I have been watching these posts and picked up a lot of useful tips from this community. I recently got a promotion on April 1st and I am trying to leverage technology to help automate some tasks for my guys to get them out of work earlier.

    I have this organizational loading sheet and I am trying to have it return certain information about an order, based off of the shipment number.

    The formula I am trying to figure out would be in cell E13.

    I want the formula to look at a range of cells (E4-E10). If there is nothing there, I want it to return a value that equals a cell in another tab of the same worksheet called ORDERS!H4.

    If it finds something in E4 and not E5, I want it to return the value in cell ORDERS!H5. If it finds something in E4 and E5, I want it to return the value in cell ORDERS!H6...so on and so forth.

    I am probably missing something really simple, just frustrated because the project was going well and then I got stuck on this part.

    Thanks!

  2. #2
    Registered User
    Join Date
    08-23-2011
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    57

    Re: IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows

    I’m not an excel expert, but (assuming what you mean is that if a cell within the range E4-E10 has something in it, the cell(s) above it within the range will also have something in it), couldn’t you just use: =OFFSET(ORDERS!$H$4,COUNTA(E4:E10),)?

  3. #3
    Registered User
    Join Date
    04-16-2019
    Location
    South Dakota, United States
    MS-Off Ver
    2013
    Posts
    50

    Re: IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows

    I used your example and it ended up counting the blank spots and shifting the value in the 'H' column accordingly. So it sort of worked in the opposite direction of how I wanted it, perhaps I was explaining it poorly.

    Since E4:E10 was blank, I wanted it to return ORDERS!H4. If there was something from E4 to E9, for example, I wanted it to return ORDERS!H10.

    Any clearer?

  4. #4
    Registered User
    Join Date
    08-23-2011
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    57

    Re: IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows

    I’m not sure why the formula didn’t work for you, as it produces every result you mention for me. Here it is in excel, if that’s helpful.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-16-2019
    Location
    South Dakota, United States
    MS-Off Ver
    2013
    Posts
    50

    Re: IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows

    After downloading your file, I realized I made an omission...completely my mistake.

    The E4:E10 range all return blank values but the cells themselves have formulas that determine that. Once I deleted the formulas in E4:E10, it worked exactly as you had indicated excel-help.

    The problem is that I need to keep the formulas in those cells. How do I re-write the formula in E13 to accomplish this? So instead of looking to see if the contents/formulas of the cell are completely blank, it needs to look to see if the results of the formula return something blank or not.

  6. #6
    Registered User
    Join Date
    08-23-2011
    Location
    California
    MS-Off Ver
    Excel 365
    Posts
    57

    Re: IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows

    Based on what you’re describing, I would think either of these should work for you (based on whether or not cells E4-E10 are truly blank or simply contain a formula that results in ""):
    =OFFSET(ORDERS!$H$4,SUMPRODUCT(--(LEN(E4:E10) > 0)),)
    =OFFSET(ORDERS!$H$4,ROWS(E4:E10)-COUNTBLANK(E4:E10),)

  7. #7
    Registered User
    Join Date
    04-16-2019
    Location
    South Dakota, United States
    MS-Off Ver
    2013
    Posts
    50

    Re: IF Formula Looking at a Range of Cells to Figure Out Correct Outcome by Shifting Rows

    Got it working, thanks so much for your help!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Cant figure out correct formula
    By Madman7000 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-02-2018, 11:56 PM
  2. shifting the cells of some rows 1 column to the right
    By nazaninibb in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-07-2018, 10:46 PM
  3. Replies: 4
    Last Post: 07-27-2015, 07:27 AM
  4. [SOLVED] "If" formula not bringing up correct outcome
    By joamer in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 11-08-2014, 01:25 PM
  5. Replies: 3
    Last Post: 10-10-2014, 08:14 AM
  6. Macro to correct formula outcome
    By pinas in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2012, 12:10 AM
  7. [SOLVED] A correct formula gives an incorrect figure
    By GarMcCas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-17-2006, 06:55 PM

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