# Compare 2 Cells If One Cell Is Greater Than 0

Mar 6, 2007I need a formula for: If cell c is greater than 0 and cell c is<> cell b return value of cell c in cell d; else value of cell b in cell d.

View 4 RepliesI need a formula for: If cell c is greater than 0 and cell c is<> cell b return value of cell c in cell d; else value of cell b in cell d.

View 4 RepliesADVERTISEMENT

Battling through a problem, but would like to get some feedback on some failing code.

basicly created a bunch of macros to get 2 columns. One has last months dates, and the other has the new ones.

I want it to check if the date in columnH is greater then columnJ then update (i have vlookups to get this info with offsets). You see if there is no result on columnH it means it does not add a date.

heres the code that i have. The error is that i am using an invalid statement in the case ( i suspect the >=)

how to return the highest value of repeated controls in column A.

when comparing the numbers repeated in columns "A"

will return the highest value in column "D"

control

plug

block

value

Formula

115

20

1012

28,9

31,2

this is the highest value of repeated controls in column A

[Code] .......

I want to count the times that a value in one column has a value of one greater than the value of the corresponding cell in another column.

(For example, A1=1 and B1=2, A2=1 and B2=2, etc.)

I've tried =COUNTIFS(A1:A180, (B1:B180)+1) and =COUNTIFS(A1:A180, "="&(B1:B180)+1) with no luck.

(It gives me a value of zero, but I can tell just by looking at the numbers that there should be at least a few times when this event occurs.)

I'm comparing budgeted dollars vs. actual dollars spent by month. So row 10 has 13 columns (column A is title and then B-M is Jan-Dec) with each cell containing a budgeted dollar amount. Row 26 is same setup but contains actual dollars spent for those months. I want to highlight any cells in row 26 that are greater than the same cell in row 10. So if H26 is $1,000 and H10 is $500, I want H26 to be highlighted in red. How can I do this without having to conditionally format each individual cell as I can't seem to make this work with a cell range in Conditional Formatting?

View 3 Replies View RelatedI am working on a Golf League score sheet, and each week there may be a different amount of players that play. I have a weekly worksheet (attached) that contains the full list of golfers that had played that week and I only want to sort the columns for those golfers who have a score greater than 0 (this would be the ones who played that week). You can see that in week 1 I had more players than in week 2. So in my weekly worksheet I sort these sub grids by Score first. However I ONLY want to sort the rows that have a score greater than 0. Can this be done in VBA or am I stuck doing this manually every week?

Week1.PNG

Week2.PNG

I have a list of numbers in two columns. All I want to do is that if the number in column B is larger than the number in column A I want it to be in red font. I know I need to use the Options>View - Zero Values.", "style="background: ...

View 6 Replies View RelatedI would like to have a complete column compared with its immediate next values and delete the values whose difference is more dhan 5.Im new to VB programming.

D

12.90

13.34

19.90

26.90

21.55

If dis is my set of data how should i use range values?

Here is what i want to do. # I have a workbook say 'Template', which has two columns: ColA -> Names , ColB -> Value, his acts as a template, i.e a budget. # Another workbook 'sample' which has similar ColA(may contain additional rows) and corresponding value in ColB.

Here is what i need::

I need to copy the contents of ColA and ColB of 'sample' wholse ColB valules are greater than ColB values of 'Template' for corresponding ColA values in both, into a new workbook. SO basically, template acts as a budget check for the sample workbook, and if any value in ColB goes above the budget in template, it will show up in the new workbook. I have attached both the workbooks. Basically the red highlighted cells in Sample are the ones i want in a new workbook.

I am using cell V7 to input the formula but I want cell V7 to tell me if the number in U7 is greater than or equal to the individual #'s in cells U7-U40 and I would like it to put a 1,2,3 in the cells of V7-V40 for the three highest numbers in order of largest to smallest if is this possible?

View 3 Replies View RelatedI have a sheet that I populate with data, and I would like to create a formula (or some code) that will look down column A, and if any of the cells contain a value >1 copy the cell and the adjacent cell (column B) and paste both values into a new sheet.

View 2 Replies View RelatedI am trying to use the SUMIF function in excel where I want to sum a range of cells greater than whatever is in cell D8. Here is what I tried to use, but it doesn't work. SUMIF(A2:A10,>D8,B2:B10)

The content in D8 can change because the user makes a choice from the drop-down list and a number pops up in D8 that is referenced to their choice.

I have to make a table that shows that a if someone purchases

less than 5 items they receive no discount

5-10 items they receive 2% discount

11-20 items they receive 5% discount

21-50 items they receive 8% discount

over 50 items they receive 10%

and it has to be done in a way that the discount rate can be calculated using Vlookup I am struggling to find the best way to write this table. i tried numbering 1 to 50 and writing the corresponding discount rate in the second column but this looks untidy and can't calculate greater than 50 as i am not sure how to write it in the cell so it reads as >50 and not just 50.

I'd like to compare two cells, and if the first cell is either >150, <161, OR =165 AND the second cell is ="E" to output a 1, and if false, output a zero.

I have =IF(AND(AND(Sheet1!B3>150, Sheet1!B3<161, Sheet1!B3=165 ),Sheet1!E2="P"),"1","0")

But i know that is incorrect because Sheet1!B3 can not be greater than 150 AND less than 161 AND = 165. I can't figure out how to make it >150 AND < 161 OR = 161.

I want to compare a cell with a number of other cells to check if their value is the same. If it is the same an IF function will perform some action.

For example I want to check if A23 is equal to B23,B24,B25.....B50

Something like IF (A23= B23 to B50,"hi","bye")

The problem is that I dont know how to write "B23 to B50" in a format Excel will understand.

I need a formula that will look at cell A1 and compare it against column B, if it finds it, show that value, if not, show "not found".

View 6 Replies View RelatedI am trying to add a third if statement to my existing code looking to see if a cell in a column is blank and the corresponding cell in another column contains a number that is greater than or equal to 1. I can't figure out how to write that part of my IF statement.

If Cells(r, 4) = " " And Cells(r, 3) >= 1 Then

Cells(r, 1).Resize(1, 5).Interior.ColorIndex = 35

Set rng = Union(Cells(r, 1), Cells(r, 3), Cells(r, 4))

rng.Copy

Worksheets("Sheet1").Range("G40:I40").End(xlUp).Offset(1, 0).PasteSpecial (xlPasteValues)

Application.CutCopyMode = False

Cells(r, 5) = "NEW"

End If

Next r

I am trying to compare two cells and if they match then I want to fill in a list on sheet one from sheet two.

I have the absolute working when I compare one cell to one cell, but I can't get it to compare one cell to a range of cells (two weeks of days)

Here is the absolute one I have working:

=IF(C1='Data Sorted'!A1,'Data Sorted'!A2,"")

Here is what I tried that doesn't work:

=IF(C1='Data Sorted'!A1:N1,'Data Sorted'!A2,"")

I have three cells - A1, B1, C1 and each contains a value of yes or no.

If more than two of the cells say "yes", I want the fourth cell (D1) to display "yes."

If less than two columns say "yes", I want the fourth cell (D1) to display "no" .

I've a spreadsheet and I need to find cells in Column A that contains certain text and subsequently being able to compare the data in 2 other cells (column F and Column J) and post the results of comparison in Column L. Please see the tables below:

In this table, if Range("A1") contains abc, then data in Range("f1") would be compared against Range("J1"). If F1 = J1, then Range("L1") would say "ok" otherwise "needs to check" as in Rows 2.

Please note that the amount of data varies daily.

ColumnA

Column F

ColumnJ

Column L

abc

fff

fff

ok

abc

fff

ggg

needs to check

bbb

fff

fff

I have a if function that i am creating in excel 2000, and it has 8 variables. I am trying to put it in a macro as it is not working as a nested if function. Here is the current if function...

=IF(B2=C2,"OK",IF(B2=D2,"OK",IF(B2=E2,"OK",IF(B2=F2,"OK",IF(C2=0,"OK",IF(D2=0,"OK",IF(E2=0, "OK", IF(F2=0, "OK", "INCORRECT"))))))

the excel file is attached for further clarity

I have two sheets:

- sheet 1 ('current')

- sheet 2 ('31May')

The data in column C is the same, although sorted differently and can't be re-sorted to be the same. Where the data in column C is the same in both sheets, I want to fill columns A and B into sheet 1.

I have a workbook with tons of programming I need to achieve. Here is my work book so it can be viewed.

Right now on "Protocol" Sheet I want the cells with the "Protocol 1" field to look at Admin_Panel Sheet and find the row with the same text. Then take the text in cell A of the same row and copy it to the cell below the "Protocol 1" listed on the protocol sheet.

I have spreadsheet with different 100s of columns of dates with 600 rows. The first row identifies which zone the data belongs to (North, South, East, West. NE, SW, SW1, etc...)

I want to write a formula to check how many dates in each column fall in 2015 or later years; This can be accomplished by writing a countifs formula.

Where it gets complicated is once i filter on the Zones;

I want the formula to give me the desired result - count of all CELLS where the year is 2015 or greater - WITH FILTERS ON.

I stumbled upon following sumproduct formula that gives count for visible cells, however when i apply the date criteria, i get incorrect result -

=SUMPRODUCT(SUBTOTAL(3,OFFSET(IJ3:IJ999,ROW(IJ3:IJ999)-MIN(ROW(IJ1:IJ999)),,1))*(IJ3:IJ999>DATE(2014,12,31)))

How do I count the number of cells that have a value greater than 0 in a range of cells?

View 2 Replies View RelatedI have three cells with data: 23.40, 12.34, and 0

I'm looking for a formula that will add up the cells only when all three cells have a value greater than zero. In other words, if the last cell is zero I would like the value of the formula to =0 until data is entered

I have a spreadsheet which calculates times from previous columns, I need to include only one of 2 columns whichever is the greater and in the next column only add the difference of the greater column if it is greater then the sum of 2 other columns as shown in attachment

Time in seconds

A B C D E F G

17837423078B1+E1+F1+ THE GREATER OF C1 OR D1B1+E1+F1+ IF C1 OR D1 IS GREATER THAN E1+D1 ADD THE DIFFERENCE IGNORE IF NOT

17882423078B2+E2+F2+ THE GREATER OF C2 OR D2B2+E2+F2+ IF C2 OR D2 IS GREATER THAN E2+D2 ADD THE DIFFERENCE

I'm trying to count all cells in a row after the last number that was greater than 0. See my example spreadsheet. I have put the answers that it should be in to show what I'm after.

[URL]

I have made a spreadsheet that essentially works out a cost dependant on which department the work was completed in.

I have a seperate tab with the department names in column A and the charge rates in column B

On the second tab I have a spreadsheet that has columns A and B for hours used and material cost.

The third column is the dept name

The 4th column is the variable charge rate which changes dependant on which department is put in colum 3

The 5th Column is the total cost.

In the 5th column I have this formulae:

=VLOOKUP(F7,'Variable Costs'!A3:B16,2,FALSE)

This work fine.

However, the spreadsheet has about 200 entries per week and all the cells in column 4 and 5 are showing "#N/A" becuase there are no values for them to work with.

I don't like seeing this and normally will use the "IF" function to say that if column A and B are greater than 0 then do the sum, if not show "0"

This for some reason doesn't work with VLOOKUP. Not the way I am using it anyway

=IF(D7:E7 >0,"=VLOOKUP(F7,'Variable Costs'!A3:B16,2,FALSE)",0)

I want to divide the numbers from 2 cells, down a long column. Let's further say that in some instances there aren't any numbers in either of the cells. You get a divide by zero error.

So you have values in a1 and b1 through a10 and b10. You want to divide the value in the a column by the value in the b column and return the answer in the adjacent c column. You've copied the formula all the way down to c20.

All the cells from c11 to c20 will have divide by zero errors.

What is the syntax to check if both cells in columns a and b are greater than zero so that either an answer will be returned or just a blank cell will result, (when nothing is in one of the cells from a or b?

The following formula works for checking the status of cell A, how do I also check the value in cell B?

=(IF(A5>0,A5/B5,""))

something like?:

=(IF(A5>0 and B5>0,A5/B5,""))

Copyrights 2005-15 www.BigResource.com, All rights reserved