IF/THEN Statement With Calculation
Nov 6, 2008I would like to perform what seems like a simple calculation: =IF C1>0, THEN A1-C1, IF C1=0, THEN DO NOTHING. How would this look as a formula?
View 4 RepliesI would like to perform what seems like a simple calculation: =IF C1>0, THEN A1-C1, IF C1=0, THEN DO NOTHING. How would this look as a formula?
View 4 RepliesI am putting together a spreadsheet that needs to perform different calculations based on the information that is plugged in to the spreadsheet. Right now, I have a simple formula for my final product, which is:
=G2-E3-F3+C3+D3
But, if the variables change, then I have another cell with this formula:
=IF(OR(C4=0,D4=0),"",SUM(G2,H3))
Now, my first problem is that I need to get the information regarding D4 out of the above formula. Someone wrote the formula below to combine the information in cell C3 & D3, so I no longer need the reference to cell D4 in the above formula. How to remove the D4 references without getting an error.
You will notice that the 2nd formula has cell C4. This cell has an IF statement in it. The statement is as follows: =SUM(IF(C3=0.875,D3-0.625,D3))
Basically, what I need to do is to combine the first & second formulas on this page. How to do that.
I have several columns as so:
B - Patient Surname
C - First Surname
D - Postcode
E - Date
F - Results of If Statement (Days Difference)
I am looking to comapre b, c, d with teh previous cells to make sure I am looking at the same person hcen the AND statement. If they all match then if subtracts the latest date (column E) from an ealier date for the same person. If the person is different it will return a 0. If the date is the same ti will return a 0.
I have done this so far - =IF(AND(B2=B1,C2=C1, D2=D1),(E2-E1),0)
What I am struggling to do is if the number of days (E2-E1) is 0-3 then for the result to show the text "Less then 3". If the value is 4 - 7 then to have it read "Less then 7", anything over 7 to read "OVer 7".
I need a If statement that can be used on 2 columns.
If there is a 1 in the first column I want to indicate if the 2nd column is 50% or greater with a number 1.
This formula is being used in a vacation time spreadsheet. So after each paycheck the if statement is applied and need to calculate the accumulation for that week based on if the person has worked 5 yrs or less. I need to stop the today's date calculation in the if statement after it is used. So that each time the spreadsheet is opened the values are a fixed number not changed based on the current date. However if the if statement is pasted into the next pay week it will calculate based on the actual date.
It is calculating is the following:
C4 = 5yrs Anniversary Date of Hire
3.08= less than 5 yrs
4.62= more than 5 yrs
=IF(($C$4)<=TODAY(),4.62,3.08)
[URL] ......
Is it possible to insert a formula or have a calculation performed for the range component when using the countif statement.
I am trying to take the entries in the rows in column B and divide its corresponding row in column A and then count how many meet a certain criteria.
I'm trying to design an if statement that refers to a range of cells on a calculation sheet to perform one calculation on TRUE; another on FALSE
=IF(A22='Calculation Sheet'!A27:A36,B22*100/16,B22*100/8)
When I view the formula in Function Arguments window, Value_if_true = 1043.75 & Value_if_false = 2087.5 <- these are correct
IF Func Arg.jpg
When I view the cell in the spreadsheet, system displays #VALUE!
When I view Evaluate Formula window, it seems Excel doesn't like the text.
IF Form Eval.jpg
I am currently using an Intersect statement in a worksheet module to perform two things:
1. Insert a time stamp into row 2 when row 1 has a price inserted
2.To clear that time stamp if the price is deleted at some later date.
My problem is with the time stamp value being deleted by the user.
If I try to clear the price (now that the time cell =empty) I get a Runtime error 91 - Object Variable or With block variable not set.
I would like to convert this code to a select case statement but I'm not sure how to do this in this situation. Would error coding be appropriate in this instance?
make a calculation(addition) and use the answer to multiply against another addition calculation....
The sum of (Monday!A1:A4) multiplied by the sum of (Monday!B1:B4) plus (Tuesday!A1:A4) multiplied by the sum of (Tuesday!B1:B4) and so on.
I'm trying to set up an if statement that will recognize that if a cell is FHR it will do something...but if it's PHR it will do something else. I think I found the place where I keep getting an error but I'm not sure how to go about fixing the issue.
View 2 Replies View RelatedI am attempting to use a previously Set variable as part of the next Set statement, pretty unsuccessfully at present.
My purpose is trying to look up
Code:
tb_SelJobID.Value
from a userform in Col Z then look across the row to Cols D,I,N,S & W (different types of work) to see if
Code:
TbSelYr.Value
matches the year selected then insert a formula in the row to the left. Then loop down to the FinalRow.
Currently my Set Found1 statement does not recognise my Found10 value. I know it will be my syntax as it always is. I have cut down the following code to display where the problem areas are, Found1 thru 5.
Code:
Sub CmdGo3_Click()
Dim Row As Range
Dim FinalRow As Long
Dim Found1, Found2, Found3, Found4, Found5, Found10 As Range
Application.ScreenUpdating = False
[code]....
Windows 7 with Excel 2010
I have an Excel Sheet which I use as Database. The database has 11 columns and I insert data with the following function:
Code:
Sub testInsert()
Dim adoCommand As New ADODB.Command
Dim sQuery As String
Dim i As Integer
Dim strTest As String
strTest = "test"
[Code] .......
Now I want to retrieve this data. i.e. I want all F1 where F2 and F3 are 0 AND I want them ordered descending. I'm trying to achieve this with:
Code:
Sub testSelect()
Dim adoCommand As New ADODB.Command
Dim sQuery As String
Dim mrs As New ADODB.Recordset
Dim strTest As String
strTest = "test"
[Code] ....
The result I am getting looks like this:
9
8
7
6
5
4
3
2
15
14
13
12
11
10
1
I assume, that the data is interpreted as String instead of an integer. But I explicitely stated the data as Integer when storing the data into the DB.
I have created a very long switch statement, which is too long to be placed in one row in VBA. I have attempted to put a space and underscore at the end of one line and continue the statement on the row below by placing a comma at the start of the second line. VBA will accept my efforts, but when I run the statement in the immediate window, the following error appears.
"Invalid procedure call or argument"
I understand that there are certain rules where I can split a switch statement onto two lines, yet I do not know what they may be.
I am looking to have one formula containing two If Statements that minus.
=IF(B6="investment",C6,0)-IF(B7="gross",C6,0)
So the result of If Statement 1 minus the result of If Statement 2.
What I am seeing at the moment in the cell is FALSE and what I want to see is the sum.
If A1 shows 10:00am and A2 shows 4:00pm, then A3 calculates the total number of hours: =(A2-A1)*24
But if A1 shows "Off," then A3 shows 0: =IF(A1="Off",0,(A2-A1)*24)
Now, if I want to change "(A2-A1)*24" to another if-statement, how do I do this? I can always set up a hidden cell (A4) that contains the results of the first if-statement, and then say: =IF(A1="Off",0,A4). But can I do this without going through all the trouble of setting up hidden cells?
Each row represents a call. If a call in column A equals "CW" and it has the highest duration (H:MM:SS) value in column B, then provide me the date (MM/DD/YYYY) for that call that is stated in column C.
i.e.
Column A --- Column B ---- Column C
AB ------------ 0:02:22 ----- 04/14/2007
CW ----------- 0:03:13 ----- 04/16/2007
CW ----------- 0:01:42 ----- 04/13/2007
Thus, the value that should be returned is "04/16/2007".
I have a problem with a formula inserted with control+shift+enter
The formula is
MEAN(IF(' VALIDATION'!$G$2:$G$59999=D30;'VALIDATION'!$E$2:$E$59999))
In the Validation sheet I have the column G with values 0 and 1, and another column E with numeric values.
Changing the value of cell D30, the formula will calculate the mean of the values in column E that have a value equal to D30 in column G.
The problem is that this function works when D30=1 and not when d30=0, in this case the formula returns N/D.
I have tried using also text values instead of 1 and the formula works . The problem is only when D30 is 0
I am trying to have a cell in sheet "Summary" count the number of cells in column DX of sheet "Analyses" that are greater than 0, provided that the value in column A of "Analyses" corresponds with the value in B8 of sheet "Summary."
(In "Analyses," there are 106 subjects, each taking up 64 rows. So, columns 1-64 correspond to Subject 1, columns 65-128 correspond to subject 2, etc. In column DX, each subject has 64 values that are either 0 or greater than 0. In "Summary," each subject has one row that summarizes the 64 trials. I want a single cell in the "Summary," sheet to reflect the number of times each subject produces a value greater than 0 in column DX of "Analyses.") I tried using this formula, but it did not work correctly:
=COUNTIF(IF(Analyses!$A$1:$A$10000=Summary!B8,Analyses!$DX$1:$DX$10000,""),">0")
(Summary!B8 = 1, so I am trying to calculate the number of values in DX that are greater than 0 only for subject 1.) When I press enter, this yields a value of 384. This is impossible, given that subject 1 only has 64 possibilities of yielding a value greater than 0. Subject 1 has 2 values in column DX that are greater than 0. I tried making this an array formula by pressing Shift+Ctrl+Enter, and that just gives me a #VALUE! error.
I have a series of monthly revenues and want to calculate each month a commission % - but only want this commission calculated up to a defined limit from the previous months and current month and then to stop when the limit is reached.
View 13 Replies View RelatedA
B
C
D
F
1
Received
Overdue
Completed
Untouched
[code]....
Overdue is received in previous slot and still under dependency.
Formula used for untouched - B2+C2-D2
SLA Target Min - 98% and Max 99%
Algorithm - (Total Number of Allocations completed within 5 business days Plus Type A Exclusions) / Total Number of Allocations received minus Type B Exclusions) * 100
I need a individual SLA achieved % which includes untouched too.
Hoping someone might be able to kindly help me out with this one. It's for a spreadsheet of call charges (credit crunch thing).
On the sheet, I have the call charge up to an hour ($H$5). Over an hour, it's charged per minute at the rate in $H$6.
In cell E27 I can enter the number of minutes for the call.
So basically, if E27 is up to a value of 60 then the cost is just H5, if the value in E27 is 61 or more then it's H5 + (E27-60)*H6.
I'm thinking it's an 'IF' but keep making a mess of it...
How do I calculate YTD from 1 MTD cell? The YTD cell needs to keep a running total of the MTD cell. If the current YTD cell has the number 11 in it and I typed 2 in the MTD cell the YTD cell needs to increase by 2.
View 9 Replies View RelatedWhat I need is to add a field that gives a gross margin percentage for a project.
To begin, I simplified the following data that the Pivot Table is using. Project (10 different projects), Account Number, Account Category (Revenue, and Cost), Debit Amount, Credit Amount, and a manually inserted column named Total (CR Amount - DR Amount). See 1st image. Pivot1.jpg
I have designed the Pivot table so it lays out like this. Pivot2.png Pivot3 (2).png
I have been trying to enter a calculated field that would automatically provide the Gross Margin Percentage. In the 2nd image, the Grand Total is the gross margin, but I am unable to use that as a selection when creating a calculated field.
I am trying to figure out the calculation steps that Goal Seek is doing behind the scenes so I can create the formula rather than clicking on goal seek whenever I need to make a change. I need to maintain certain weeks of supply every week depending on the sales. Let's say i want to maintain 5 weeks of supply every week, I would like to insert a column for "Suggested To Order' column that would change if weeks of supply goes below 5. In this scenario I would do a Goal Seek, but I want to automate the calculation so I don't have to do this step every week.
View 2 Replies View Relatedi need to total a range of cells, however, these contain time values; hh:mm:ss. it shows me the total when all cells are highlighted. but =sum() doesn't work.
View 2 Replies View RelatedI have a spreadsheet with several formulas where I have to go into each one of them to activate the calculation. I use F2 and enter. Automatic calculation is on. Do any of you know how this can be done automatically. A VBA-code will fit the purpose.
View 3 Replies View RelatedMy understanding of Excel is that the calculations are performed in Column A first and then down through the rows in Column A. After all the calculations are finished in A, the calculation moves over to Column B and down the rows in B. Is this true?
I know that Excel is a little more complicated than that especially when it creates a queue for calculations, etc. However, assuming there's no calculation list/queue, would the above be correct?
I'm creating a spreadsheet to calculate materials with the following columns Cost/10% of Cost/Customer Cost/Qty/Total cost.
I understand that whilst showing rounded to 2 decimal places excel stores more than this in the cell. which then throws out the Total cost by a few pence.
My research leads me to believe I need to use the ROUND function but I'm unsure which cell to use it or how.
I have spreadsheet that tracks the the rain total for several days. I would like to be able to break it down to the days of weeks that has rain and how much without manually imputing the data.
Days | #of times | total amount
Mon
Tue
Wed
Thu
Fri
Sat
Sun
I have a data in excel , sample sheet attached.
and i have another place for compile where all the data is summarized
What i want is
If the agent name is example 1 and his mistake is present in raw data and it matches the agent id , date and financial then i want excel to calculate how many " financial " error agent made on that particular date only so that i can assign to another agents too , to get exact data no matter in whichever series that data is inserted in excel.
if i use countif and if all the condition are met it shows me all financial mistakes count and if it shows false it turns to zero . if agent make " financial mistake " on 1st nov and he made another non financial mistake then as it should show only the count of that particular agent " financial mistake " on that date only from the given RANGE DATA