Home > Forum Home > Excel Business Valuation Template > validating two columns and sum and max each column and display results Share

Validating two columns and sum and max each column and display results

Excel Help for Validating Two Columns And Sum And Max Each Column And Display Results in Excel Business Valuation Template


Forum TopicPost Reply Login

Validating Two Columns And Sum And Max Each Column And Display Results

Rate this:
(4/5 from 2 votes)
ConfusedHi,

I dont do coding but i been stuck with a task.

In Excel i have two drop down lists that have validated each other. so one row depends on the selection of another.

What i need is to select a value in x drop down and then sum up the total of the value in y and find the max value of x. Then divide x with y. (finding average of total sales (y) with maximum days of the month (x)) The result then needs to be displayed in another column for each row.

The code below is wrong and keeps giving me the absolute total of row y and dividing it by the max value of y. Also it only displays in one cell.

Help would be massively appreciated.  Thanks


Sub CalculationInvestedAmount()
    Dim MaxDays As Integer
    Dim InvestmentAmount As Double
    Dim InvestmentTotal As Currency
    
    MaxDays = Application.WorksheetFunction.Max(Range("K:K"))
  
    InvestmentAmount = Application.WorksheetFunction.Sum(Range("F:F"))
   
    InvestmentTotal = InvestmentAmount / MaxDays
    ActiveCell.Value = InvestmentTotal
   
End Sub
 Posted by on
 
Replies - Displaying 1 to 2 of 2Order Replies By: Most recent | Chronological | Highest Rated
Confused
Rate this:
(3/5 from 1 vote)
nice post
 Posted by on
Confused
Rate this:
(2/5 from 2 votes)
@doodle jump Edit VBA to sum column Y, find max column X each row, divide the value and display the result each row.
 Posted by on
 Displaying page 1 of 1 

Find relevant Excel templates and add-ins for validating two columns and sum and max each column and display results in the