+ Reply to Thread
Results 1 to 18 of 18

How to combine IF statement in OFFSET function?? Please Help

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Exclamation How to combine IF statement in OFFSET function?? Please Help

    Hello!

    Please see my workbook attached to this post.

    I am working on a formula and I can't figure out how to combine the IF fucntion inside the OFFSET function to make it work properly. The file is a timesheet where I want to fill out the timesheet with task I've done through out the day (This have all the task for other people too).

    This is what I want it to do:
    1. Select initial under "Name"
    2. Once name is selected it will show 5 tasks from my short list/"Full List" under "Task" worksheet (If I pick a different name it will the 5 items from that persons short list) so under the day the following options is what I want it to appear, Task5, Task10, Task16, Task19, Task21, and "Full List"
    3. I can pick any of those 5 tasks, or if i click on "Full List" it will show all the task for that person, and so forth for other persons

    (I want to be able to pick any name, and then it will show me their own short list, and "Full List" for their task only. I don't want to pick a name but then show ALL the tasks because i'll have over 100 tasks on the list, just what their task is only). Is this possible to do??

    I cannot combine the IF statement for the "Short List"/"Full List" into the OFFSET formula. Please see "Data Validation - Swith Lists" for the IF formula.


    Please help me with this problem, much would be appreciated

    Thank you!!
    Attached Files Attached Files

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

    Re: How to combine IF statement in OFFSET function?? Please Help

    Here you go...
    Attached Files Attached Files
    _________________
    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!)

  3. #3
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Re: How to combine IF statement in OFFSET function?? Please Help

    Wow thank you sir, you're a genius. I have no idea how you did that formula but it works! thnx!

  4. #4
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Re: How to combine IF statement in OFFSET function?? Please Help

    Hi JBeaucaire,

    I have a problem with the worksheet, when I try to enter the real task into the excel sheet in the "Task" worksheet the string is broken and it doesn't show up on the drop down menu. How to fix this? and also in your code how did you reference it back to the "Task" worksheet when your on the "Master Timesheet"? Also how to move the "Full List" option last e.g. Task1, Task2, Task3, Task4, Task 5, Full List, instead of Full List at the begining?

    Please Login or Register  to view this content.
    Please help

  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: How to combine IF statement in OFFSET function?? Please Help

    I moved all the ShortList groups down one cell and added Full List to each group. If you're going to add Full List at the bottom of each group, then just take out the -1 at the first spot it appears in the formula.


    =IF(D12<>"Full List", OFFSET(INDEX(ShortList, MATCH("*" & B12 & "*", ShortList, 0)),,,COUNTIF(ShortList, "*" & B12 & "*")+1,), OFFSET(INDEX(FullList, MATCH("*" & B12 & "*", FullList, 0)),,,COUNTIF(FullList, "*" & B12 & "*"),))
    Last edited by JBeaucaire; 06-06-2012 at 05:09 PM.

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

    Re: How to combine IF statement in OFFSET function?? Please Help

    Thanks for the feedback.

    If that takes care of your need, please select Thread Tools from menu above and set this topic to SOLVED.

  7. #7
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Re: How to combine IF statement in OFFSET function?? Please Help

    Hi JBeaucaire,

    Could you take a look at the spreadsheet again, I do not know how you defined Shortlist in "Index" function. As you can see the list becomes broken and unselectable after I enter the actual tasks that i'm suppose to do. Could you explain to me how you define it because I am not very good at excel functions.

    Kind Regards,
    Attached Files Attached Files

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

    Re: How to combine IF statement in OFFSET function?? Please Help

    Yeah, your original sample made it appear we could use the A.K code in the COUNT formulas for the ShortList and the FullList, but then you took them out. So we can't use them.

    You can delete the named range ShortList, we won't need it, and redefine the FullList as column A on the Data Validation sheet. Then you can switch the data validation to this:

    =IF(D12<>"Full List", OFFSET(INDEX(FullList, MATCH(B12, FullList, 0)),,1,COUNTA(OFFSET(INDEX(FullList, MATCH(B12, FullList, 0)),,1,COUNTIF(FullList, B12))),), OFFSET(INDEX(FullList, MATCH(B12, FullList, 0)),,2,COUNTIF(FullList, B12),))
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Re: How to combine IF statement in OFFSET function?? Please Help

    Hi JBeaucaire,

    Sorry but your formula is too complex for me to understand, I do not know what you mean. Everytime I want to add an item in (Insert a row) the data shifts down one and the table doesn't look up all the data. So I could not add new tasks or new users into the spreadsheet because everytime i do it the formula stops working. I tried to play with it but I have no clue what to do. I'll have to add few more people and maybe 30 more tasks onto the table so it becomes a problem when I don't know how to fix the formula to give the range for look up, or when i delete a task or user it also stops working.

    Could you explain how to reference when i need to add/delete new users/tasks on the spreadsheet, explain it like I'm a 5 year old kid (Micheal from "The Office")

    Thank you so much!
    Plz bare with me.

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

    Re: How to combine IF statement in OFFSET function?? Please Help

    The formula is complex, it's actually two formulas in one... but the results are not. You should be able to add new sections in the TASK sheet for new people, as many as you want. The only named range we are using now is called FullList and it is the entire column A on that sheet, so you can add as many groups as you want.

    You will need to post an expanded example so I can see how it fails after your edits. It shouldn't.

  11. #11
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Re: How to combine IF statement in OFFSET function?? Please Help

    Hi JBeaucaire,

    I finally figured out how to fix the issue, thank you so much for your help!!! +rep!!

    I got another question, say there are 4 divisions

    1. Finance
    2. Marketing
    3. Human Resource
    4. Accounting

    Then say I fill out my timesheet and for example all the Task #10 for all users belongs to Finance, Task #15 belongs to Marketing, Task #16 belongs to HR, and Task # 18 belongs to accounting. So my question, is there a formula where I can fill out at the bottom of the page under Finance, Marketing...etc that can identify the Tasks that I fill out on the timesheet and automatically calculate .25 for each certain tasks that are fill out into the specific cell?

    I could have the users caculate their own hours for their tasks that goes into what division, but the problem is say the task #10 is suppose to be under Finance but John Doe puts it as Accounting. So if they put it in the wrong task under wrong division the allocation is incorrect. I want to minimize as much human error as possible. Please see attached for example

    Is there such a formula for this?

    Thank you!
    Attached Files Attached Files

  12. #12
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to combine IF statement in OFFSET function?? Please Help

    You could use:

    In D68: =COUNTIF(D12:D65,"*10")*0.25
    In D69: =COUNTIF(D12:D65,"*15")*0.25
    In D70: =COUNTIF(D12:D65,"*16")*0.25
    In D71: =COUNTIF(D12:D65,"*18")*0.25

    to get the 4 totals for Monday. Is that what you meant?
    Last edited by Cutter; 06-11-2012 at 12:18 PM.

  13. #13
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Re: How to combine IF statement in OFFSET function?? Please Help

    Yes that formula seems to work, but how do i combine multiple tasks together? for example if "Monitor Bank Acconts" & "Process Month End" & "Reconcilliation" belongs to Accounting how do I combine multiple task togeter in one formula. I'm trying to combine the "COUNTIF" and the "AND" functions together and it doesn't seem to work.

    Please Login or Register  to view this content.
    Could you help me refine this?

    Thank you!

  14. #14
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: How to combine IF statement in OFFSET function?? Please Help

    I don't see what you mean. Perhaps adding the 2 digit code to the end of those task titles would be easiest?

    Or

    =SUM(COUNTIF(D12:D65,{"*Monitor Bank Accounts","*Process Month End","*Reconcilliation"}))*0.25

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

    Re: How to combine IF statement in OFFSET function?? Please Help

    Don't let his question fool you, Cutter, his actual tasks won't have #'s like that in them, he got me with that earlier.


    I've created 4 new "named ranges" on your LIST sheet. Just drop the "tasks" into each column for the category that it goes with, the named range is dynamic and will expand itself. Notice the Human Resource one is named Human_Resource.... no spaces in named ranges.

    Then on the Master I've added some array formulas at the bottom.

    =SUM(--ISNUMBER(MATCH(D$12:D$65,INDIRECT($A68),0)))*0.25
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Re: How to combine IF statement in OFFSET function?? Please Help

    Haha JB you know me too well :P

    The formula you have made on the page works great! But one problem I ran into is I tried to recreate your formula on my master time sheet that I have with the list manager and everything for the 4 divisions except they are named differently that's all. I copied your formula over and it does not work on my worksheet. How do you define the "Accounting", "Marketing" etc... in the formula to relate to the list? I also notice you have { } in the SUM formula, what does this mean and what does it affect? Please show me how to recreate your formula on my sheet since it does not work when I copied it over.

    Thanks JB!


    Quote Originally Posted by JBeaucaire View Post
    Don't let his question fool you, Cutter, his actual tasks won't have #'s like that in them, he got me with that earlier.


    I've created 4 new "named ranges" on your LIST sheet. Just drop the "tasks" into each column for the category that it goes with, the named range is dynamic and will expand itself. Notice the Human Resource one is named Human_Resource.... no spaces in named ranges.

    Then on the Master I've added some array formulas at the bottom.

    =SUM(--ISNUMBER(MATCH(D$12:D$65,INDIRECT($A68),0)))*0.25

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

    Re: How to combine IF statement in OFFSET function?? Please Help

    Press CTRL-F3 to open the name manager, in there you will see there are named ranges for each department that is defined as the whole column, no need to get any fancier than that. Once you have the named ranges defined the formula as given should work.

    The formula is an array, so when you're done editing it you confirm it by pressing CTRL-SHIFT-ENTER, activating the array. The curly braces { } will appear to indicate the array is active.

  18. #18
    Registered User
    Join Date
    05-29-2012
    Location
    Cowtown, AB
    MS-Off Ver
    2010
    Posts
    30

    Re: How to combine IF statement in OFFSET function?? Please Help

    Perfect it works Thanks JB!

+ 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