+ Reply to Thread
Results 1 to 3 of 3

Assistance with developing complex formula

  1. #1
    Registered User
    Join Date
    12-01-2020
    Location
    Vancouver
    MS-Off Ver
    365
    Posts
    19

    Assistance with developing complex formula

    I'm hoping one of you wizards can help me out with something that is likely very easy if you know what you're doing.

    This will be complex to explain, and I'll try to not complicate with potentially extraneous information.

    Columns B-U are a weekly measurement called WHZ, where:
    WHZ is < -3 is conditionally formatted red
    WHZ is >= -3 and < -2 is conditionally formatted gold
    WHZ is >= -2 is conditionally formatted green

    Columns V-AO are the weekly weight measurements.

    Columns AP-BI are what I'm seeking help for.

    What I need help with is figuring out the formula to return the correct dosage of a food product based on the child's weekly WHZ and weight, based on the following:

    - if WHZ is <-3 then the formula should use the dosage by weight formula (see below)
    - if WHZ is >=-3 for one visit, the formula should also use the dosage by weight formula (see below)
    - if WHZ is >=-3 for two consecutive weeks, then the formula should return a value of 14 (NB: it's important that it is consecutive weeks, if not then the child follows the dosage by weight formula; it's the consecutive weeks requirement that is causing me trouble)

    Dosage by weight formula:
    =IF(V2>=12,35,IF(V2>=10.5,32,IF(V2>=9.5,28,IF(V2>=8.5,25,IF(V2>=7.0,21,IF(V2>=5.0,18,IF(V2>=4.0,14,IF(V2>=3.0,11,""))))))))

    In semi-plain English, the child should receive a dosage based on their weight until they have a WHZ >=-3 for two consecutive visits. Once they have WHZ >=-3 for two consecutive visits then they get 14 sachets of product regardless of their weight. Since growth is not linear, their WHZ might drop below -3, and then they have to go back to a weight based dosage until they reach WHZ >=-3 for two consecutive visits again.

    In columns BJ-BX I’ve manually calculated what the values should be with the correct formula to help with cross-checking that it is working correctly.

    Any assistance with creating this formula would be greatly appreciated!
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Assistance with developing complex formula

    Your words said WHZ>=-3, but your manual outcome said >=-2?

    I assum your manual outcome are correct, try in AP2:

    Please Login or Register  to view this content.
    Correct -2 into -3 which is correct.

    Drag down and accross
    Attached Files Attached Files
    Quang PT

  3. #3
    Registered User
    Join Date
    12-01-2020
    Location
    Vancouver
    MS-Off Ver
    365
    Posts
    19

    Re: Assistance with developing complex formula

    Thank you very much! This formula is exactly what I was looking for.

+ 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. Developing a 'Par' Formula
    By AdamMinder in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-18-2020, 01:25 PM
  2. [SOLVED] assistance to modify complex formula from reading 30ea to 30
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-08-2018, 11:09 PM
  3. Inherited Complex Formula, Need Assistance to Change
    By DHartwig35805 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-22-2013, 04:29 PM
  4. Replies: 11
    Last Post: 04-17-2013, 04:45 PM
  5. Macro assistance needed for complex export/import excel file
    By dedavie in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-28-2013, 02:47 PM
  6. Need assistance with complex IF formula
    By mccormickj in forum Excel General
    Replies: 0
    Last Post: 09-01-2011, 01:13 PM
  7. Need help developing a formula
    By FarleyP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2006, 01:38 AM

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