If formula question.

Tofik

Board Regular
Joined
Feb 4, 2021
Messages
114
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi guys, I need some explaining in IF formula. How can I write condition with IF to automate check my Data Base from my table automatically?

something like this: =IF( E3=F3 then past value from G3 in C3 cell) + =If( I already have value in C3 cell but it is not the same as in G3 then change it on right one frome the table and as additional give a red color to me for visually viewing the mistake place in MY Data base).

I need to fully automate C3:C6 column to auto check from MY TABLE by two Column A and B.

Thanks !!!



What I have
MY DATA BASEMY TABLE
THINCH odTHINCH od
12312314,5
1541542,11
1839183931,5
What I need
MY DATA BASEMY TABLE
THINCH odTHINCH od
12314,512314,5
1542,111542,11
183931,5183931,5
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
is this it?

Book2
ABCDEFG
1What I have
2MY DATA BASEMY TABLE
3THINCH odTHINCH od
412314,512314,50
51542,111542,11
6183931,05183931,05
71840#N/A183818
8
9
10What I need
11MY DATA BASEMY TABLE
12THINCH odTHINCH od
1312314,5012314,50
141542,111542,11
15183931,05183931,05
Sheet1
Cell Formulas
RangeFormula
C4:C7C4=VLOOKUP(A4,IF(($E$4:$E$6=A4)*($F$4:$F$6)=B4,$E$4:$G$6,NA()),3,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:C7Expression=ISERROR($C3)textNO
 
Upvote 0
is this it?

Book2
ABCDEFG
1What I have
2MY DATA BASEMY TABLE
3THINCH odTHINCH od
412314,512314,50
51542,111542,11
6183931,05183931,05
71840#N/A183818
8
9
10What I need
11MY DATA BASEMY TABLE
12THINCH odTHINCH od
1312314,5012314,50
141542,111542,11
15183931,05183931,05
Sheet1
Cell Formulas
RangeFormula
C4:C7C4=VLOOKUP(A4,IF(($E$4:$E$6=A4)*($F$4:$F$6)=B4,$E$4:$G$6,NA()),3,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:C7Expression=ISERROR($C3)textNO
I don't Shure by 100% I will try it now and give a comment. Give me 15 minutes to understand the process.

Please Check this. It is my main idea and my main DB.

I search nearly 2 days on YouTube and Google but I cant find an example and that's why I decided to use =IF function and divide work to little steps by =IF formula.
To be honest I don't know which right request I should write on Google because I don't know the Formulas type or name. But now I understood I can do it somehow with VLOOKUP as did it you.
I don't know how to link main DB and Table with 100% right values for autocheking.
 
Upvote 0
So from what I gathered. you have 2 tables:

1 with expected results and the other with some manual entries that might contain error.

so this:
Excel Formula:
=VLOOKUP(A4,IF(($E$4:$E$6=A4)*($F$4:$F$6)=B4,$E$4:$G$6,NA()),3,0)

is Vlookup with criteria.
A4 contains what we are searching for, but table_array argument contains if statement:

Excel Formula:
IF(($E$4:$E$6=A4)*($F$4:$F$6)=B4,$E$4:$G$6,NA())

we are comparing all values from range
Excel Formula:
$E$4:$E$6
to a value in
Excel Formula:
A4
Receiving bunch of TRUE and FALSE.
the same is happening here:
VBA Code:
($F$4:$F$6=B4)
with more TRUE and FALSE
only when both ranges get a TRUE which is basically equal to 1.we are telling IF to grab a Range
Excel Formula:
$E$4:$G$6
so we will get only rows (records) that match both criteria, if they don't we get whats in the False argument for if which is
Excel Formula:
NA()
Function.
Then in col_index of vlookup we state which column we want to retrieve from specified range in the IF statement.
 
Upvote 0
Solution
is this it?

Book2
ABCDEFG
1What I have
2MY DATA BASEMY TABLE
3THINCH odTHINCH od
412314,512314,50
51542,111542,11
6183931,05183931,05
71840#N/A183818
8
9
10What I need
11MY DATA BASEMY TABLE
12THINCH odTHINCH od
1312314,5012314,50
141542,111542,11
15183931,05183931,05
Sheet1
Cell Formulas
RangeFormula
C4:C7C4=VLOOKUP(A4,IF(($E$4:$E$6=A4)*($F$4:$F$6)=B4,$E$4:$G$6,NA()),3,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:C7Expression=ISERROR($C3)textNO
I try it and understand how I can work with =IF formula. It is good but how I can see mistakes without replace the original value. Is It possible see it *** notes or something like this ?

1624528355905.png

or I should open the new control column ?
I just want see difference what I had previous and what I have in fact ( from 100% true table ).
 
Upvote 0
you can do it however you want.
if you apply my solution ull get a value from specified column as explained. now yu can do simple comparison to get TRUE / FALSE
just add = at the end of my formula and compare it to control cell

Excel Formula:
=VLOOKUP(A4,IF(($E$4:$E$6=A4)*($F$4:$F$6)=B4,$E$4:$G$6,NA()),3,0)=ControlCell.
you can also subtract:
Excel Formula:
=VLOOKUP(A4,IF(($E$4:$E$6=A4)*($F$4:$F$6)=B4,$E$4:$G$6,NA()),3,0)-ControlCell

if you don't want to see NA error but some text:
then change NA() to "SomeText"

for any case ull need additional column to put vlookup in
you can also put as many criteria as you want
(CriteriaComparison1)*(CriteriaComparison2)*CriteriaComparison3)*...*(CriteriaComparisonN)

@Tofik

Are you from Poland by any chance?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top