Consulting

Results 1 to 5 of 5

Thread: Solved: help with below formula.

  1. #1
    VBAX Tutor
    Joined
    Sep 2009
    Posts
    231
    Location

    Solved: help with below formula.

    Hi All,

    I needed help with the below formula which is not working :

    H4-IF(C4<>"",B4,IF(AND(C4<>"",D4<>""),B4*2,IF(AND(C4<>"",D4<>"",E4<>""),B4*3,I F(AND(C4<>"",D4<>"",E4<>"",F4<>""),B4*4,IF(AND(C4<>"",D4<>"",E4<>"",F4<>"", G4<>""),B4*5)))))

    In fact i have one column which keeps the daily target example 200 pcs. what i want is to see the varaince from the daily production total versus the targeted qty on a daily basis.

    that is every time the daily production is enter the target qty shall change accrodingly.

    example :

    target : 200 pcs

    1st day prod 120,
    the target will be : 200
    2nd day prod : 120
    the target shall be : 400

    and then on the varaince column i do total prod - total targeted like :

    240-400 to see the varaince .

    but with my formula its remaining still with the first day.

    thanks to see attached sheet for examples.

    Many thanks for the help if this is possible.

    Attached Files Attached Files

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    hi.
    try
    [vba]=H4-(B4*COUNTIF(C4:G4,">0"))[/vba]
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  3. #3
    VBAX Tutor
    Joined
    Sep 2009
    Posts
    231
    Location

    help with below formula.

    Hi,

    many thanks for the help its working this way but in real the data is not organize in this way. My error for not posting the correct way the data is organise in fact :

    the Day 1 header has 2 column : 1 is OPr and other production and its the production that needs to be counted .

    Am trying this but not working :[vba]
    =(B5*COUNTIF(D5,F5,H5,J5,L5),">0"))
    [/vba]

    Am attaching a corrected example of how its really organise .

    many thanks again for the help.
    Attached Files Attached Files

  4. #4
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    try

    [vba]=(B5*SUM(D5>0,F5>0,H5>0,J5>0,L5>0))[/vba]

    or
    [vba]=(B5*SUM(COUNTIF(INDIRECT({"D5","F5","H5","J5","L5"}),">0")))[/vba]

    or
    [vba]=(B5*(COUNTIF(D5,">0")+COUNTIF(F5,">0")+COUNTIF(H5,">0")+COUNTIF(J5,">0")+C OUNTIF(L5,">0")))[/vba]
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  5. #5
    VBAX Tutor
    Joined
    Sep 2009
    Posts
    231
    Location
    Hi ,

    Thanks a lot its working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •