Comparing 2 ranges of values to a single cell - excel

I want to compare 2 ranges of values to a single cell. I want to compare each row of both columns combined. Not just any value in column A and any in column B. It must be A1 & B1, A2 & B2, etc.
Example:
A1 : 1
A2 : 5
A3 : 7
B1 : 2
B2 : 3
B3 : 6
C1 : 11
I could use this formula:
=IF(OR(AND(A1<C1,B1>C1),AND(A2<C1,B2>C1),AND(A3<C1,B3>C1)),0,C1)
But I need to check a range of more than 100 cells so using AND would bloat the formula.
Which formula do I use?
Thanks in advance.

use COUNTIF():
=IF(COUNTIFS(A:A,"<"& C1,B:B,">" & C1),0,C1)
If any fit then it returns 0 other wise C1

Related

Excel : Automate value generation in excel

Generate value P in 5 different cells when I have value 5 input in a different cell
Example A1 has value 5
B1 to b5 cells should generate value P in those 5 cells
If I change value of A1 to 7
it should generate P in b1 to b7

Formula to find the last populated cell in a column and add to it?

If column A is marked with an X, the adjacent cell in column B will find the last populated cell in column B and simply +1 to that.
For example: If A1 is marked and B1 is HF2056, and it skips a row so that A3 is marked with an X, B3 would need to auto fill to be HF2057.Image with fake numbers for example
So how do I formulate it so that if a cell in column A is marked with an X, the adjacent cell in column B will find the last filled cell in B with data and fill in the new number?
I feel like this may be an ISBLANK formula but I can't figure it out.
Thank you in advance!
Assume : A1 is X and B1 is HF2056, A2 is blank, A3 is X
Then, in B2, formula copied down :
=IF(A2="","",LEFT(LOOKUP(1,0/(A$1:A1="X"),B$1:B1),2)&RIGHT(LOOKUP(1,0/(A$1:A1="X"),B$1:B1),4)+1)
And, formula result:
B2 : (blank)
B3 : HF2057
Remark :
The above formula result will give max number in HF10000.
If you want the number keep to increase by 1, the B2 formula will be changed to :
=IF(A2="","",LEFT(LOOKUP(1,0/(A$1:A1="X"),B$1:B1),2)&RIGHT(LOOKUP(1,0/(A$1:A1="X"),B$1:B1),LEN(LOOKUP(1,0/(A$1:A1="X"),B$1:B1))-2)+1)

Comparing values of a range of cells to a single cell's value

I want to compare values of a range of cells to a single cell's value. I want to know if any cell's value of the range is smaller.
Example:
A1 : 1
A2 : 5
A3 : 7
A4 : 9
B1 : 2
I could use this formula:
=IF(OR(A1<B1,A2<B1,A3<B1,A4<B1),0,B1)
It does what I need. But I'm looking for a more elegant and practical formula than OR because I need to check a range of more than 100 cells.
Which formula do I use?
Thanks in advance.
EDIT: COUNTIF worked fine but now I want to compare a range of values in the same row of 2 columns to a single cell.
Example:
A1 : 1
A2 : 5
A3 : 7
B1 : 2
B2 : 3
B3 : 6
C1 : 11
=IF(OR(AND(A1<C1,B1>C1),AND(A2<C1,B2>C1),AND(A3<C1,B3>C1)),0,C1)
COUNTIF just checks if any cell within and the range is smaller or larger. It doesn't match the rows though.
You can calculate the minimum value of column A in a cell and compare it to value in B1.
=IF(MIN(A1:A4)<B1,0,B1)

Date selection in Excel

I have a cell that has a date for my business "week ending". I would like to program three other cells to change when I change the data in cell 1.
Example:
Week Ending. 08/21/15
Wk 2. 08/27/15
Wk.3. 09/3/15
Wk 4. 09/10/15
When the week ending date is changed, the other three weeks automatically change in increments of 7 days.
Anyone know of this is possible? A million thank yous in advance!
Just use the 'Add' formula in rest of the 3 cells e.g. use the following configuration in your cells.
Cell C1 = 08/21/15
Cell C2 = C1 + 6
Cell C3 = C2 + 6
Cell C4 = C3 + 6
in this way, when you change value in C1, value of other 3 cells C2, C3 and C4 will change accordingly.

Compare 2 cells in row a with 2 cells in row b

i wonder if you can help i am trying to highlight the row if the data in cell A1 and B1 match the data in A3 and B3,
For Example
A B
1 - ONE TWO
2 - THREE FOUR
3 - ONE TWO
So A1 & B1 = A3 & B3 could both rows be highlighted to show they match, any help would be much appreciated.
Kind Regards,
Andy
Have you tried =AND(OR(A1048575=A1,A1=A3),A1<>0) applied to =$A:$B?
Edit

Resources