Formula not working as intended - also open to new way of achieving result

hrachao

New Member
Joined
Sep 19, 2018
Messages
16
Hi again!

My formula isn't working as intended anymore. Here is what I wanted:
I have 3 worksheets:
WS1


WS2WS3WS4
Vendor nameExpiry dateFormula fieldVendor nameVendor nameVendor name
Alpha31-12-2018AlphaAlphaAlpha
Beta31-12-2016BetaGamaGama
Delta31-12-2017
GamaN/A
GamaN/A

<colgroup><col><col><col><col><col><col><col><col span="2"></colgroup><tbody>
</tbody>
Conditions for formula:
If vendor in WS1 is not in WS2 nor WS3 nor WS4, then return blank ""
if vendor in WS1 is in WS2 OR WS3 OR WS but the expiry date is "N/A" or > 31/12/2018, then return blank ""
if vendor in WS1 is in WS2 OR WS3 OR WS4, then return text "request form" ONLY IF the expiry date is < 31/12/2018



I was using:
=IF(B3="N/A","",IF(B3<DATE(2018,12,31),IF(OR(NOT(ISERROR(MATCH(A3'[WS2]'!$D:$D,0))),NOT(ISERROR(MATCH(A3,'[WS3]'!$L:$L,0))),NOT(ISERROR(MATCH(A3,'WS4'!$A$1:$A$4184)))),"Request Form",""),""))

But with this formula, if the expiry date is <31/12/2018 it gives me "request form", even if the vendor name is not present in other worksheet

Thx for your help!!

Rgds,
Helena

<colgroup><col width="64" style="width:48pt"> </colgroup><tbody>
</tbody>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Help with multiple conditions (if, OR, match/search, dates)

Hi!

I have 4 worksheets:
WS1WS2WS3WS4
Vendor nameExpiry dateFormula fieldVendor nameVendor nameVendor name
Alpha31-12-2018AlphaAlphaAlpha
Beta31-12-2016BetaGamaGama
Delta31-12-2017
GamaN/A
GamaN/A

<tbody>
</tbody>


Conditions for formula:
If vendor in WS1 is in WS2 OR WS3 OR WS4 AND expiry date is < 31/12/2018, then return text "request form"

If vendor in WS1 is not in WS2 nor WS3 nor WS4, then return blank "".
If vendor in WS1 is in WS2 OR WS3 OR WS but the expiry date is "N/A" or > 31/12/2018, then return blank ""


I was using:
=IF(B1="N/A","",IF(B1 < date(2018,12,31),if(or(not(iserror(search(a1,'ws2'!$d:$d,0))),not(iserror(search(a1,'ws3'!$l:$l,0))),not(iserror(search( a1,'ws4'!$a$1:$a$4184)))),"request="" form",""),""))

<date(2018,12,31),if(or(not(iserror(search(a1,'ws2'!$d:$d,0))),not(iserror(search(a1,'ws3'!$l:$l,0))),not(iserror(search(a1,'ws4'!$a$1:$a$4184)))),"request form",""),""))
But with this formula, if the expiry date is <31/12/2018 it gives me "request form", even if the vendor name is not present in other worksheet

Thx for your help!!

Rgds,
Helena</date(2018,12,31),if(or(not(iserror(search(a1,'ws2'!$d:$d,0))),not(iserror(search(a1,'ws3'!$l:$l,0))),not(iserror(search(a1,'ws4'!$a$1:$a$4184)))),"request>
 
Last edited by a moderator:
Upvote 0
Re: Help with multiple conditions (if, OR, match/search, dates)

in Sheet1 (no result cell specified)

=IFERROR(IF(AND(OR(A2=Sheet2!A2,A2=Sheet3!E3,A2=Sheet2!F3),YEAR(B2)<=2018),"Request Form",""),"")
 
Last edited:
Upvote 0
Re: Help with multiple conditions (if, OR, match/search, dates)

in Sheet1 (no result cell specified)

=IFERROR(IF(AND(OR(A2=Sheet2!A2,A2=Sheet3!E3,A2=Sheet4!F3),YEAR(B2)<=2018),"Request Form",""),"")

Hi! Thanks for your input. Something is not working yet. I have a vendor of WS1 present in WS4 with date <31.12.2017 and i get blank return "" instead of "request form". any idea what could be the reason?
 
Upvote 0
Re: Help with multiple conditions (if, OR, match/search, dates)

"I have a vendor of WS1"

Vendors are Alpha Beta Gamma Delta arent they? There is no vendor with a value of "WS1" is there? if there is your description doesn;t reflect that.

You've now produce THREE different types of date format in your description of the problem 31-12-2018, 31/12/2018 and now 31.12.2017.
So are we talking about text or proper Excel dates?

When you are comparing vendors are you comparing a vendor in a particular cell of other worksheets or the WHOLE COLUMN of the other worksheets? Your table implies it's cell by cell comparison.
But you're description mentions other worksheets. If thats the case you should have provided SEPARATE tables not one merged table.
 
Upvote 0
Re: Help with multiple conditions (if, OR, match/search, dates)

Hi, you are totally right, my input was very faulty... I am having trouble with formatting in this forum. Let me try and remake it, would still love to get some help.
 
Upvote 0
Re: Help with multiple conditions (if, OR, match/search, dates)

I have 4 separate worksheets. Each worksheet has 1 set of information.

The idea is to check if a vendor name (column A) from worksheet 1 is present in any of the other worksheets (also in columns A) - so the formula needs to check the whole column of the other worksheets
Then, if the vendor is indeed present in any of the other worksheets, "request form" should be returned if the date of expiration in column B of worsksheet 1 is <31-12-2018. All dates are properly formatted as date in the worksheet.

Worksheet 1: columns used are A (vendor name) and B (expiration dates). Formula is intended to be put on column C and dragged down

1 31-12-2015
2 31-12-2017
3 31-12-2020
4 N/A
4 N/A
5 31-12-2017

Worsksheets 2, 3 and 4

All vendors are present in column A of the respective worksheet. The whole column should be checked in the formula, as these files are regularly pdated with further rows.

(I changed the vendor names to just simple numbering now)

Is this clear?
 
Upvote 0
Re: Help with multiple conditions (if, OR, match/search, dates)

Try

=IFERROR(IF(AND((COUNTIF(Sheet2!A1:A1000,A2)+COUNTIF(Sheet3!A1:A1000,A2)+COUNTIF(Sheet4!A1:A1000,A2))>0,YEAR(B2)<=2018),"Request Form",""),"")
 
Last edited:
Upvote 0
Hi hrachao
Assuming that the vendor name is in column A on all sheets if not then change to suit, and that you are going to paste this into sheet 1 on cell C2 then try this. I've left the text in so you can see what it is doing, where B2>43465, this is the Microsoft date number for the 31/12/2018.

=IF(IFERROR(INDEX(Sheet2!$A:$A,MATCH(A2,Sheet2!$A:$A,0),1),IFERROR(INDEX(Sheet3!$A:$A,MATCH(A2,Sheet3!$A:$A,0),1),IFERROR(INDEX(Sheet4!$A:$A,MATCH(A2,Sheet4!$A:$A,0),1),"")))=A2,IF(OR(B2="N/A",B2>43465),"N/A or greater than 31/12/18",2),"Not in any worksheet")
 
Upvote 0
sorry that should be paste into sheet1 cell C3, also when pasting that formula in it has added a space on the last IFERRO R, please remove that too
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,243
Members
449,075
Latest member
staticfluids

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