+ Reply to Thread
Results 1 to 14 of 14

Complicated IF and COUNTIF for a bakery spreadsheet

  1. #1
    Registered User
    Join Date
    08-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Complicated IF and COUNTIF for a bakery spreadsheet

    Hi there,

    I was helped out earlier on this forum but have started a new thread as this is a slightly different issue.

    I have a Bread_subs sheet and a Delivery sheet. I have a formula on the delivery sheet which pulls together data from the Bread_subs sheet including customer name, type of bread and delivery day.

    What this fails to do, is make sure the person's subscription is up to date.
    The data for bread subscriptions is in columns G and H of the Bread_subs page.

    For the formulas in the Production boxes I used this bit of code to only count the bread if it was within the right dates (some people have bread orders which start in September)

    =SUMIFS(I12:I149,K12:K149,"Wed",J12:J149,"WS",G12:G149,"<="&D1,H12:H149,">="&D2)

    At the moment the formula on the DELIVERY sheet doesn't include this.

    Is there a simple way of including it so?

    Many thanks!
    Attached Files Attached Files
    Last edited by twigdip; 08-08-2013 at 11:23 AM.

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

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    I would add a helper column to Bread Subs with formula in O12:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    copied down.

    then revise formula in Delivery A3 to:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Note: The order of appearance on the Delivery sheet will not be necessarily in alphanumeric order as per column N in Bread_subs sheet.
    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
    08-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Thanks. I think that will work except that I can't complete the first step without some blank cells appearing for example O17 goes blank when I copy the formula down from O12.

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

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    It's blank because the date range is not in the required date range.... so I purposely ignored it... isn't that your requirement?

  5. #5
    Registered User
    Join Date
    08-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Thanks for clarifying! It works well in Excel 2007 but not in an older version of Excel and sadly I can't seem to shift it to OpenOffice.
    Any ideas for a way of expressing the formula without using IFERROR (which is a new code I think)?

    Many thanks again for your help

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

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    for OO you will have to replace all commas with semi-colons..... (i am not sure if all the other functions are compatible)

  7. #7
    Registered User
    Join Date
    08-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Wow that works brilliantly on Excel. Sadly OO doesn't like it..the cells remain blank after conversion of the formula.
    Shame because all the other stuff you suggested works really well!
    Any other options?

    Thanks yet again!

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

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Did the formula on the first page work? it has COUNTIFS which is also only post 2003 compliant.

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

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    You can replace with this:

    =IF(AND(G12<=$D$1,H12>=$D$2),LEFT(N12)&"_"&SUMPRODUCT((LEFT(N$12:N12)=LEFT(N12))*(G$12:G12<=$D$1)*(H$12:H12>=$D$2)),"")

    copied down.

    Not sure if SUMPRODUCT is liked by OO ???

    According to http://wiki.openoffice.org/wiki/Docu...ed_by_category it seems all the functions in my formulas exist in oO too.
    Last edited by NBVC; 08-08-2013 at 11:01 AM.

  10. #10
    Registered User
    Join Date
    08-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Thanks again. Yes, the COUNTIFS works fine on the first page in both Excel and OO.

    Need to figure out a way to make the formula on the Delivery page work. Then we will have cracked the puzzle completely!

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

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    I am surprised that COUNTIFS works... I couldn't find evidence that the function exists in OO....

  12. #12
    Registered User
    Join Date
    08-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Don't really understand why, but it works perfectly now in both system.
    What an amazing job you've done!
    Really appreciate the help

  13. #13
    Registered User
    Join Date
    08-08-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Quote Originally Posted by NBVC View Post
    I am surprised that COUNTIFS works... I couldn't find evidence that the function exists in OO....
    One of my computers is using OO 4.0 which was released 2 weeks ago...so maybe it's been introduced!
    Lucky for me

    Thanks again for your help

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

    Re: Complicated IF and COUNTIF for a bakery spreadsheet

    Great, you are welcome.

+ 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. Complicated Spreadsheet
    By Brodysseous in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-29-2013, 04:48 PM
  2. complicated countif
    By vchibisov in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-30-2012, 10:45 AM
  3. Complicated COUNTIF function
    By Avinit in forum Excel General
    Replies: 6
    Last Post: 02-01-2012, 04:56 PM
  4. The bakery problem
    By skoo in forum Excel General
    Replies: 1
    Last Post: 03-31-2011, 12:06 AM
  5. Replies: 0
    Last Post: 02-03-2005, 02:06 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