+ Reply to Thread
Results 1 to 11 of 11

[SOLVED]If with Name Range

  1. #1
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    [SOLVED]If with Name Range

    I have set up 3 name ranges.
    1) D9:D14 Date
    2) E9:E14 Commission
    3) F9:F14 Paid

    I want row 2 automatically recognized the correspond Commission amount when the week has included the first day of the month.

    I also want row 4 to accumulate the Commission if prior paid name range show N.

    I believe I need to use if statement. Any formula will be fine as long as it works with name ranges.

    Thanks.

    Jackson
    Attached Files Attached Files
    Last edited by jackson_hollon; 11-25-2014 at 03:22 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: If with Name Range

    Any formula will be fine as long as it works with name ranges.
    Not sure why you need that, the formula below works just fine for what you want...
    =VLOOKUP(IF(DAY(G$1)>1,EOMONTH(G$1,0)+1,G$1),$D$10:$E$14,2,1)

    However, if you MUST use ranges, then your range needs to include both columns for the vlookup...
    =VLOOKUP(IF(DAY(G$1)>1,EOMONTH(G$1,0)+1,G$1),range,2,1)
    where range is the range name for D10:E14

    This will give you the sum...
    =IF(C2="","",SUM($C$4:C4))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: If with Name Range

    Ford,

    Thanks for the help.

    Both formulas have a little bit problems. They do not work the way I want. Both formulas gave me value in every week.

    The following are what I want:

    For row 2, I only want the value in the week that include the first day of the month.

    For row 4, I only want the value accumulated if paid column in the prior month is N.

    Could you please give some more help?

    Thanks again for the help.

    Jackson

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: If with Name Range

    Edited, again:

    I'm not sure that I get it. Have a look at the attached.
    Attached Files Attached Files
    Last edited by FlameRetired; 11-21-2014 at 05:11 AM.

  5. #5
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: If with Name Range

    FlameRetired,

    Thanks for the help.

    It is almost there. Except the date is one week behind on your formula. For example: Jan 1st should be included in week of column K. On your formula, it showed it is on column L.

    Thanks again for the help.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: If with Name Range

    I have come up with this, but most of the dates that pull in data, do not match with yours.

    =IF(AND(EDATE(EOMONTH(C$1,0)+1,-1)-7<C$1,EDATE(EOMONTH(C$1,0)+1,-1)+7>C$1),VLOOKUP(IF(DAY(C$1)>1,EOMONTH(C$1,0)+1,C$1),$D$13:$E$17,2,1),"")

    edit: FT is having the same problem as I am - not taking into account when the end of the month is in the week with the 1st day of the next month

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: If with Name Range

    Quote Originally Posted by FDibbins View Post
    I have come up with this, but most of the dates that pull in data, do not match with yours.

    =IF(AND(EDATE(EOMONTH(C$1,0)+1,-1)-7<C$1,EDATE(EOMONTH(C$1,0)+1,-1)+7>C$1),VLOOKUP(IF(DAY(C$1)>1,EOMONTH(C$1,0)+1,C$1),$D$13:$E$17,2,1),"")

    edit: FT is having the same problem as I am - not taking into account when the end of the month is in the week with the 1st day of the next month
    Thank you, Ford. I thought I was the only one...

    I also suspect I've been looking at the math backwards......I'm attempting another go at this one.

    Flame
    Last edited by FlameRetired; 11-21-2014 at 02:55 PM.

  8. #8
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: If with Name Range

    Thank you Ford and Flame,

    I am most appreciated for all of your effort. I had played around for hours and didn't even be able to get close to what you got.

    Thank you again.

    Jackson

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: If with Name Range

    I think the attached will resolve the remaining questions. Please let us know.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    06-07-2013
    Location
    US
    MS-Off Ver
    Excel 365
    Posts
    485

    Re: If with Name Range

    Flame,

    It works perfectly.

    Thanks for the help.

    Jackson

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: If with Name Range

    You're welcome. Glad it worked.

    Edit: and thanks for the rep.
    Last edited by FlameRetired; 11-26-2014 at 11:29 PM.

+ 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. [SOLVED] reference date time range, return the value into all cell that match datetime range
    By Jarvco13 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-22-2013, 10:39 PM
  2. [SOLVED] Count number of occurances below a range, within a range, and below a range
    By maacmaac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2013, 11:36 PM
  3. Replies: 4
    Last Post: 03-17-2013, 05:58 AM
  4. send to range, popup box to input what the range should be each time/select range
    By lax2734 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2012, 01:37 AM
  5. Code to select range and open a user form is opening the wrong range
    By rrbest in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-05-2010, 12:34 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