Multiplying By 0 But Keeping Existing Result - Conditional Multiply
Nov 10, 2008
I know when you multiple anything by 0 the answer is 0.
But I have a list of numbers I need to multiply out
but want to keep the total even if there is a 0 in the sequence
Eg
A1*A2*A3*A4
10*15*0*11
5*21*6*0
0*14*10*0
So A1*A2=150 if I then multiply by A3 I get 0, but I need to ignore the cells that have 0.
So for the last example my answer would be 140.
I want to be able to enter a value into a cell (within a specified range) and have it automatically multiply by a set value and overwrite the original entry with the result so making it all happen within one cell. The set value would be another cell on that sheet.
So the range for example is "H17:H74" and the value I want to multiply by is "D8"
Is this possible?
I've looked at another forum but it wasn't working when I wanted to define the set value as a cell.
I have a spreadsheet filled with formulas that depend on a value being entered into A2, A3, A4, etc... So column A starting at A2 is where I will manually input a number and the formulas I have in columns B, C, and D will import information from another sheet based off what is put in column A. In column D the formula I have to import data
is =IFERROR(VLOOKUP(A2,Master!C:M,11,0),"").
This will import another number. Additionally in column D, I have conditional formatting that will return a red, yellow or green light based off the rule I have in place. Everything works fine, the only problem is that column D has a green light all the way down even without a value being placed in column A. I would like to find out a way to keep the cells in column D blank until a value is entered in column A. Also, if I go back and delete the value in column A, I would like the corresponding cell in column D to go back to blank as well.
My problem may seem similar to "conditional sumif", but I could not solve it with that approach. The examples of sumif or sumproduct always use
E2:E25="Low"
notation, in my case I need a range on the right hand side of that comparison. I have several brands which belong to some producers. I'd like to sum the values of all brands belonging to 1 producer. The brands and their producers are listed on the same sheet. An example is attached.
I am using the following formula (which I need to adapt) to enter a value in a cell C30. C30=IF(A30>0,A30,0) I will need to enter this formaula in column C rows 1 to 300.
The problem is that, in addition to A30 needing to be >0, I only need to enter a value in C30 if a value (>0) is found in column B (B29 going back to B1) before a value is found in the A column (A29 going A1). If a value in the A column is found first then I need to enter "0".
For example, if A30 is >0 and the previous A row A29 is >0, I want to enter 0 in C30.
Another example, If A rows A20 to A29 are 0 and B19 >0, then I want to enter A30 in C30.
I'm having trouble figuring out how to evaluate the result of Conditional Formatting using VBA.
I've got a series of cells ( dates) that are formatted in BOLD when a corresponding cell elsewhere in my spreadsheet shows that the date is Actual and not Projected ("A" vs. "P").
The Conditional Formatting works fine, I just can't figure out how to get VBA to skip the cell if the value is not BOLD based on the Conditional Formatting result.
ex:
For Each i In Selection If i.FormatConditions(1).Formula1 = True Then 'OR i.FormatConditions(1).Font.Bold = True Then i.Copy i.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Else End If Next i
I have established that to have more than 3 conditions in my version of Excel (2003) i have to use VBA. Unfortunately I have very little knowledge of this process. I have attached an example of the worksheet I am working on. The worksheet in question totals hours worked for payroll. problem:
Required result: Cell to change to 1 of 8 background colours in response to selection of 1 of 8 options in drop down list in the cell directly next it.
i.e. (in reference to attachment - sheet DATA) IF E6 = Holiday, then D6 = Red IF E6 = Half Day Holiday, then D6 = Red IF E6 = Sick, then D6 = Blue IF E6 = Sick Half Day, then D6 = Blue IF E6 = Bank Holiday, then D6 = Green IF E6 = Compassionate Leave, then D6 = Pink IF E6 = Unpaid Leave then, D6 = Yellow IF E6 = Unpaid Leave Half Day then, D6 = Yellow
However, the same basic table as shown in sheet DATA appears several times on the worksheet. And in each instance the conditional formatting is the same (in reference to the relative cells).
I am trying to use the status of Conditional Formatting to toggle on/off protection for a cell.
I have a cell with Conditional Formatting applied if the result of a formula is true. If the Conditional Formatting is applied, I want the cell protection turned on so a user can not change the entry in the cell. If Conditional Formatting is not applied (false), cell protection is turned off and the user may edit.
I have been trying to multiply cells(6,3) of sheet 'Input2' with the 23rd row of next sheet 'Input' from 4th column in that row to last used column. Then I want this looping to go from 23rd row to the last used row in that sheet. But I am not successful. The code that I tried till now is:
Sub test() Sheets("Input").Activate x = Range("D23").End(xlToRight).Select For j = 4 To x m = Sheets("Input2").Cells(6, 3) * Sheets("Input").Cells(23, j) Sheets("worksheet").Activate Sheets("worksheet").Cells(j, 17) = m Next j End Sub
I have a total number of hours I want to subtract from. Example in cell e3 I will have 800 hours. In cell f3 I have the number 2 (to represent 2 workers at 40 hours, so that should total 80). I then want f3 to multiply by 40, then that total subtract from the 800 hours in cell e3. Basically I want to be able to put 2 workers in a cell, have that multiply by 40 and minus from the 800 hours in cell e3. I want that to carry on for cell g3, etc.
Basically I have 1 value on 1 sheet and and multiple values on another sheet and I would like to know if it is possoible to mutliply these togther i.e
Sheet 1 100
Sheet 2 2,5,9,15,20....
I would like to calculate (100*2)+(100*5)+(100*9)+(100*15)+(100*20).....
I know if sheet 2 only had a few numbers like above which I have used as an example I could link the sheets; however in my data, sheet 2 is about 75 numbers that change.
This is about my misformatted download again. It considers all the numbers to be text. Naturally, I need them to be numbers. I discovered a page on the Web that says if you multiply all the numbers by 1, suddenly Excel gets a clue and figures out they are numbers. I've tried this (as the page recommended) by using Paste Special, and it works. I know the command I need to use to get it to Paste Special:
I have tried to put together three simple formulas for a very simple problem. I wanted to string together three vlookup formulas which were as follows;
The first lookup would work but as soon as I added another it would result in #n/a. I tried adding the suffix "false" after column no. but that did not work.
On the second lookup I did mix text and numbers e.g the first row in the column had a "G" in it and the rest were numbered 1-10. The second two vlookups were on a seperate sheet but in the same workbook.
I have checked the named ranges and they work fine when done individually but it seems to be the combining which messes things up.
I need to multiply the values of 10 rows by the values in 10 columns and sum then, akin to the sumproduct function, which only seems to work if the values are all in rows or all in columns.
In other words;
rows of 1 2 3.......10 & columns of
a b c . . j
Expressed as (1*a) + (2*b) + (3*c) + ....... (10*j)
I can do it long hand and I can do it by transposing the data as an intermediate step, but I was looking to do it all in one formula.
I want to merge some cells using a criteria. To be more specific, let's speak on the file attached.
Beginning with the P5 cell I want to merge to the right groups of 4 cells for each name from the column J. Therefore the first group of merged cells will be P5:S5, the next group will be T5:W5 and so on until reaches 11 groups of 4 cells. The last group will be BD5:BG5.
I tried a script like this but it says that there is a syntax error on the "Else" instruction:
However, when I dont have a value/number in A or C I get a #VALUE in the total cell. It will only calculate properly when I have numbers in all 4 cells.
Is there a way to set it up so it will calculate if cells A or C are empty? I dont want to have a zero in these cells - just leave empty if no value.
Also - when the total cell is empty I want it blank.
I am creating a spreadsheet for some deliveries. The pieces I have are all in feet and inches and multiplied by a certain quantity. I need a formula to run this and give me feet as an answer.
I have 4 cells, in A1 I have feet without the foot mark (20) and in cell B1 I have inches without the " (5). In cell C1 I have 20. How do I write a formula to do the following:
I have over 500 countries with unique shipping costs associated with each... each of them has the same mark-up price... 2.25. I am hoping to be able to insert a formula that will cover each country... i am currently entering each one indivdually (E10*2.25), then the next one (E11*2.25), etc.
I would like to map each item in the row with the column header and the price for that item for the customer, similar to the below one, go through both the work sheets, i want the output in the rowitem view.
I have to complete the following project in visual basic for Excel
direction quantity price b 400 10 b 100 20 s 900 15
So the above is a small sample space of what i have(over 3000 rows in total) they are stocks. if there is a "b" in the direction that denotes a negative (short) and if there is an "s" (long) that denotes positive.
Two parts: 1) Write a traditional macro (with button) that when pressed, will give the total Net value in a message box. 2) Secondly, write the code in 'class module' that give me the over all net value in a message box.
I understand what I need to do but just don't know how to write the code for this in visual basic.
So for the above example the net would be -400(10) -100(20) + 900(15) = +$7500
But how can I write a program to do this and display the final answer in a message box?
I need a formula for H2 to multiply the value if it is in any one of the cells in B2 - B6 by the appropriate value to calculate the annual total. Such as if the number is in weekly column it would multiply by 52, fortnightly 26, monthly 12, quarterly 4 and annually 1.
Weekly Fortnightly Monthly Quarterly Annually Ann Totals Mortgage 1000.00 Council Tax/Water/Sewerage 1000.00
I'd like automate consists of entering 56 numbers (up to 3 digits, 000-999) and finding the difference between today's numbers and yesterday's numbers. Then multiplying each difference by a set number (i.e. 1, 2, 3, 5, 10, 20, or 25). These numbers may, from time to time change (i.e. the 32nd entered number may be multiplied by 3 for 2 months, then we might swap out a product and then need to multiply by 5, etc). At the end, I need all 56 differences multiplied by their individual respective multipliers totaled. This needs to be done daily using previous days numbers and be able to change the multiplier without effective previous data.
I was trying to to this myself by Column 1 = multipliers, Column 2 = yesterdays' numbers and Column 3 = today's numbers. The calcualtions are done by excel and a total is summed. This I can do. However, each day i'd need to make a new file and enter yesterday's and today's numbers. This is time consuming. I'd like a system where I can just entere today's numbers and any changes to the multiplier and it will spit out the total.
If anyone can guide me or point me in any direction to accomplish this automation. I would greatly appreciate it. I'm pretty computer savvy, but just have not had the time to dwell into Excel.
For those interested in what this is for: I have a small business that sells instant lottery tickets. Each day we have to figure out the number of tickets sold the previous day. We have a notebook and manually write down numbers, do the substractions by a calculator and total. The table in the notebook is seperated by ticket values (i.e. $1 tickets, $5 tickets, etc). However, certain tickets run out or occasionally we need to move tickets to a different spot, thus the MULTIPLIER in the automated system would need to change.