+ Reply to Thread
Results 1 to 13 of 13

remaining quantity bar (related to total quantity)

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-21-2012
    Location
    rome, italy
    MS-Off Ver
    365
    Posts
    132

    Re: remaining quantity bar (related to total quantity)

    torachan: thank you but i would prefer to avvoid macro.

    leelnich: thank you. a quesion: the formula recall cell L4:

    what is value in the cell L4? shouldn't i use only cell K6 and M6 (Q.ty total and remaining q.ty)?

    Maybe i should use =LEFT(REPT("|",M6),M6*M6/K6)

    but what is M6*M6/K6?


    maybe is have to use
    =LEFT(REPT("|",K6),M6) ?
    Last edited by vermaccio; 06-09-2023 at 02:44 AM.

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: remaining quantity bar (related to total quantity)

    Quote Originally Posted by vermaccio View Post
    ...thank you but i would prefer to avoid macro.
    I've been working doubles for a couple of days, just got back on this last night. I see torachan beat me to it, and vermaccio's not interested, but here's my VBA code. This has 2 extra features; the bar responds to changes in EITHER column, and it handles multiple pasted entries.
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim MCL As Range, KCL As Range
    
    With Range(Cells(6, "K"), Cells(Rows.Count, "K").End(xlUp))
        Set Target = Intersect(Target, .Offset(0, 2))
    End With
    
    If Not Target Is Nothing Then
    
    For Each MCL In Target
        Set KCL = MCL.Offset(0, -2)
        With MCL.FormatConditions
            .Delete
        With .AddDatabar
            .MinPoint.Modify xlConditionValueNumber, 0
            .MaxPoint.Modify xlConditionValueFormula, "=" & KCL.Address
            .BarFillType = xlDataBarFillSolid
            
            If KCL > 0 Then
                .BarColor.Color = RGB(255, 85, 90)
            End If
            If KCL < MCL Then
                .BarColor.Color = RGB(255, 0, 0)
            End If
        End With
        End With
    Next
    
    End If
    
    End Sub
    Attached Files Attached Files
    Last edited by leelnich; 06-09-2023 at 07:25 AM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: remaining quantity bar (related to total quantity)

    Quote Originally Posted by vermaccio View Post
    leelnich:... the formula recall cell L4:

    what is value in the cell L4? shouldn't i use only cell K6 and M6 (Q.ty total and remaining q.ty)?...

    maybe is have to use
    =LEFT(REPT("|",K6),M6) ?
    Not sure what you're referring to. I might have missed some worksheet "cleanup" after de-bugging. Sorry if that caused confusion.

    Referencing THIS formula: =LEFT(REPT("|",23),23*M6/K6) , which appears in L6 and is copied down, by trial and error I found it took 23 pipes to stretch all the way across the cell. You may need to adjust that; use whatever fits. The important part is the ratio defined by M6/K6; it determines how many pipes (out of 23) are displayed.

    I could have written it like this: =REPT("|",23*M6/K6), but that would return too many pipes for the cell if M6 inadvertently exceeds K6, which would alter your row height if you have selected Wrap Text for that cell.
    Last edited by leelnich; 06-09-2023 at 07:15 AM.

+ 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] Percent complete based off quantity finished and quantity remaining
    By BigPaulMc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2022, 02:29 PM
  2. Google Sheets: remaining quantity formula???
    By denis_galenkov in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 4
    Last Post: 11-14-2020, 07:54 PM
  3. Google Sheets: remaining quantity formula???
    By denis_galenkov in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-14-2020, 06:51 AM
  4. [SOLVED] Remaining quantity calculation
    By Villalobos in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-02-2017, 02:12 PM
  5. [SOLVED] Running total of Quantity on Hand Vs Sales Vs Quantity to Produce
    By jespo1351 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2015, 07:34 AM
  6. Remaining Containers based on Quantity balance
    By thong127 in forum Excel General
    Replies: 3
    Last Post: 02-18-2015, 05:29 PM
  7. Replies: 4
    Last Post: 01-14-2015, 07:46 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