If Statement Based On Two Cell Values
Mar 28, 2009If I have any value in cell A1 then the cell should show 1 if true or nothing if false. I have managed this via
View 3 RepliesIf I have any value in cell A1 then the cell should show 1 if true or nothing if false. I have managed this via
View 3 RepliesI want to reference 2 cells to open a msgbox. Currently I use this formula in a cell "=IF(E4="C",IF(A4>30,"OT","")) I am trying to write a macro that will open a msgbox instead. This is what I've tried so far
Private Sub Worksheet_Change(ByVal Target As Range)
If Target(1, 1).Address = "$E$4" Then
If Target(1, 2).Address = "$A$4" Then
If Target(1, 1) = "C" Then
If Target(1, 2) > "30" Then MsgBox("1")
End If
If Target(1, 1).Address = "$E$4" Then
If Target(1, 2).Address = "$A$4" Then
Target(1, 1) = "F" Then
Target(1,2) > "38" Then MsgBox("2")
End If
G5 - can contain True or false
G6 - contains text but the if is on the basis of this cell being "Hand Delivered" or not
I have tried the following to illustrate what I after:
Two part question:
1. How do I structure an IF statement based on a specific cell color (e.g. if a cell is yellow, then perform function x)
2. How do I know what color is what? Is there a pantone reference? A color "name" that excel uses?
I am trying to populate a cell based on which number meets the criteria I define. This is based on sales revenue, so if the revenue is less than $6.5M, I want to use a certain value. If the value is equal to $6.5M but less than $8M I want to use another value and finally if the revenue is greater than $8M i want to use another value. Here's my formula, but it returns $0.
=IF(B2<6500000,Bonuses!J45)*OR((B2>6500000)*AND(B2<8000000),Bonuses!F45)*OR(B2>=8000000,Bonuses!B45)
What I have In Column B, I have the datesIn Column I, I have engineers name What I need I want a macro to generate Serial Nos. (1,2,3....... n) in column A If an only if the date in column B is today's date and the engineer's name matches with the PC's username
The following is my code
[Code] ....
Above code runs without errors but does nothing.
I request you to write a code for me to fill the cell values as "Not Applicable" in Column "AZ", if the "B" Column cell values = "Justified", "Approved LSAR" & "Approved SDAR".
I have attached the work book of what I am trying to accomplish.
it should compare and see if product, model for same id is the same but brand is different and the quantity of one or more of those brands=0 then the result (In column F)should combine the brands. check the attached image for more details.
View 5 Replies View RelatedI want to build a database where the user can select a specific time period. I have a static file with the time periods and the related values. For instance I have in column A1:A15 the time periods from January 2011 to Dezember 2011, but I have some dates multiple times as there are more values attached to it. For instance I have in the first 4 rows January 2011...what I want is when someone puts in the value January 2011 in cell B1 and Dezember 2011 in cell B2 that the whole static file gets copied to another location (including the multiple dates) displaying the chosen time period. Similarly if someone puts in the value March 2011 to November 2011, I want only those values to be copied.
View 4 Replies View RelatedI'm attempting to assign 1 of 4 predetermined values to a cell based on the values of entries in another cell.
View the example attached : Value assignmts.xls
Assign the Value of 1, to (D8) when any value entered in (C9) is equal to or over 380, but less than 410.
Assign the Value of 2, to (D8) when any value entered in (C9) is equal to or over 410, but less than 440.
Assign the Value of 3, to (D8) when any value entered in (C9) is equal to or over 440, but less than 470.
Assign the Value of 0, to (D8) when any value entered in (C9) less than 380.
I have a table of times which shows how long it took someone to process a form. If this value is longer than 10 minutes the cell next to the duration time contains the value 'Break Over Ten'. This is only true when the time is outside of 12:00 to 14:00. If the break is within this time period it shows 'Lunch'.
Is it possible to sum all of the time values that are over flagged as 'Break Over Ten'? This is how it looks
Event Date Start Time End Time Duration Breaks Duration Of Break
19/12/201308:43 08:43 00:00:35 00:00
19/12/201308:43 08:44 00:01:03 00:01
19/12/201309:05 09:19 00:13:15 BREAK OVER TEN00:13
19/12/201309:05 09:19 00:13:15 BREAK OVER TEN00:13
I was thinking of using SUMIF but can't work out how to total the values in the duration of break column when the cell to the left reads break over ten. Is it possible to do this?
1st - Need a macro to change a range of cells colours based on a single cell having a value greater than 0.001. ie. cells A1 - G1 need to change to grey based on cell F1 having a value greater than 0.001 entered in it?
2nd - Also a macro for deleting the text contents of cell C1 based on cell F1 having a value greater than 0.001. Therefor if cell F1 has a number greater than 0.001 it changes the colour of celss A1 - G1 and also deletes the text in cell C1?
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 need to display a set of cells based on the value of two drop down cells i have. As I am not very good at english and worse at explinations, I'll try via screen shots...
I have two dropdowns (C4 and C6) that will indicate what table to use (Second sheet / screenshot). I want that "table" to display in the yellow box on the first page. To complicate matters, some options do not have a CLA option - those starting with X. As there are 24 different outcomes and each is 3x9 if/then statements just dont seem to cut it.
P.S. I have excel 2010 and windows 7
I need to write a condition in such a way that cell IF A1= "DBR","BPR","SLR","SKR" then change cell B1 to SPECIFIC COLOUR Each condition different colour. A1 values ("DBR","BPR","SLR","SKR") is a list of selectable values. if the condition is falls then B1 should be normal (white color cell) with 0 in it.
View 1 Replies View RelatedIn the xls for each step I have 2 raws-planned and actual. Step planned duration is populated manually over the weeks.Before that row we have another reflecting the actual step status per week
I would like to find a way how cell reflecting the actual status of a step can be automatically populated (coulored) based on the colour/value of activities that are planned for that week and for that step.Activities are listed below the step and again have planned and actual row.
The rule should be : if for a week we have several activities all of them should be finished in order to have step stataus auto populated as green. If a single activity planned for that week is not done-then weekly step status should be red.
The activities for each step are grouped below the step. It seems that one of the difficult part in that request would be how formula will understand where starts and finishes the activities that belong to one step. To get that happen I placed a column showing step and another column where we activity.
What I want to achieve: those cells have number 1 ( in column E) , adjacent cell values ( In Column D) are copied to G12 in the following format:: Mark,Lark ( i.e. cell value , cell value, etc)
is it possible ( with a command button) Sample attached
I am a financial administrator & every month I have down load 4 bank accts as CSV, import into xl & code (CACode) the amounts for our accountant. I have VBA that formats, adds headings & formula etc but I have a problem/s. In H col I place CAcode & I use a sumif formula in I col to sum all the amounts with that have the same CAcode. For simplicity sake I copy the sumif down & then sort H col ascendindingly (this is done by VBA). Now I am trying write a macro to clear the contents of the cell in I col
if eg h60 = h59
then I60 clearContents, Select h59
Else select H59
Do until H3 is selected
Psuedocode
Select table (A2:I Xldown)
Sort Table by CAcode (H Col)
Set Range as H3:Xldown
Select Last cell with CAcode (Xldown) in H col
For every cell in Range (H3:Xldown)
Use If/thenIf Last cell = 2nd Last cell (H Col) then
Clear contents of I col (last row)
select 2nd Last cell (H Col)
Else 2nd Last cell (H Col)Next Cell
I have to use Xldown to select range as the range will be variable each month & for each bank acct. I need to clear contents of cell to verify that all the sub-totals of unique CAcodes of the CAcoded amounts = the totals Because I may have up to 120 rows X 3 bank accts I am slowly using vba to do my work.
Sub sort_And_delete_Sumif_amounts()
Dim r As Range
'Select range to sort
Range("A2:I98").Select
'Sort CAcode in H col ascendingly
Selection.Sort Key1:=Range("H2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
'select range for comparisomn of CAcode
Set r = Range("H3", Selection.End(xlDown))................
I'm working on a sheet that will help us with lots of data. This spreadsheet has 2 work sheets in it, one is being used as a form, the other data.
I'm having trouble with a formula on a "Form" worksheet that tells me - if a cell on the "Data" worksheet is blank, then leave it blank. If it contains the word "ON", then put an "X" in the cell.
Here's what I am using to try and get this working, not having any luck.
Any ideas?
=IF(OR('Data'!H2="",'Data'!H2=ON),””, X)
I want to tie the values of some cells on Sheet 2 to what's put in into corresponding cells on Sheet 1. Example
If Cell B3 on Sheet 1 has the string "B off" put in, Sheet 2 should automatically get "R1" in cell B12, "B off" in cell C12 and "ID123456" in cell D12. If cell B3 on Sheet 1 is empty, B12:D12 should be blank.
I want to use an IF statement that returns 3 values. I can do it to return 2.
Example: I am measuring performance of individuals. If they deliver below 50% I can return the value "Needs Improvement". If they deliver Over 60%, I need to show "Excellent" and finally if they deliver between 50% & 60% I need to return the value "Good".
I am not sure how to show 3 values.
I want to set up an if statement that does the following, where 'a' and 'b' are numerical values.
If 'a' is not a multiple of 'b' Then
...
Else
...
End If
How can I write this so VBA can understand it?
I would like to be able to search a group of cells for particular text,
placing the true of false value in another cell, using this formula;
=IF(ISNUMBER(SEARCH("ACP",A2)),"ACP","XXX")
My reason for this is that I have a large amount of data that I need to
break down. I have a column that is listed similar to below;
OR/ACP
OM/ACT
OR/MTS
O/O
The part before the / is 'system code'
The part after the / is 'module code'
I want to be able to have one additional column for system code and one
additional column for module code, without having to manually go through all
the data and make any amendments to it.
So as a result, (without the correct syntax) with 'S' being the system
Column and 'M' being the module column, what I would like to achieve is;
If cell contains "O/" then S1 = Office but if cell contains "OR/" then S1 =
Office Range but if cell contains "OM/" then S1 = Office Medium
I hope that makes sense.
Obviously repeated for the module column;
If cell contains "/ACP" then M1 = ACP but if cell contains "/ACT" then M1 =
ACT but if cell contains "/O" then M1 = O
How would I write a IF statement comparing 3 values. For example the field that it would be referencing would have values cell E51(1,2,3,4,5,6,7,...99). The pull back would be:
1-10 = $250,000
11-15 = $550,000
16+ = $750,000
I need to change the following statement to look for inexact values; i.e. the string of text (ABC) can be found in any position of that cell.
Example 12345ABC = True, 123ABC456 = True, etc.
If (ActiveCell.Value = "ABC") Then
I have a list of 100 values in Column A of the attached spreadsheet Sample.xls. I need to count the number of values between a certain percentage including both positive and negative values. Example: I need to count all values that are between 0 and +5% and 0 to -5%.
View 2 Replies View RelatedI have charts that I have to update at work, and I want to make it as fast of a process as possible. Here is an example of what I want to do.
I want to put the letter B in cell 1, then the number 23 in cell 2. I then want to concatenate those two strings, which I can do. I end up with cell 3 which says B23. I then want cell 4 to to be the value of cell B23. If the B23 in cell 3 changes to C11, I want cell 4 to be the value of cell C11.
I would use an IF(x,x,x), but I want to to take into account the fact that it could be any cell on the whole sheet which would be one hell of a nested IF statement.
I need to do this without macros if possible.
find the attached, I've some formulas on cells m,n & o and they related to each other, i just need n & o should be zero if m is zero.but the same formulas
should exist also.
I want to be able to look up values based on what I put in a seperate cell. For instance, I want to be able to type in 11 in cell B1 and have A1 return the value for E11. Then if I change the value to 10 in B1, the value for E10 would be returned.
View 3 Replies View RelatedCan you sum cells based on colour, and if so, how do you determine what code/number your colour is to input into the programming?
View 13 Replies View Related