Multiple If formula

PHIL.Pearce84

Board Regular
Joined
May 16, 2011
Messages
152
Office Version
  1. 365
Platform
  1. Windows
HI,

I am trying to get a multiple if statement to work but I've lost myself in the confusion, can anyone help?

Basically this is what I want to achieve;

1. If the completion date in Column J falls within any of the date ranges on the sheet (start date in D END DATE in I)
2. And if the values in G3,f3,e3 and C3 (which will continue up to row 2000 G4,5 ETC) then return yes otherwise no


This is my formula;

=IF(AND(J:J>=D3,I3<=I:I,"YES"),IF(G:G=G3,"YES"),IF(F:F=F3,"YES"),IF(E:E=E3,"YES"),IF(C:C=C3,"YES"),"No"))
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
You can compare a whole column worth of values to a single cell like the way you have written, i.e.
Code:
[COLOR=#333333]=IF(AND(J:J>=D3,...[/COLOR]
What is it exactly that you are trying to do?
Are you really trying to compare every single entry in column J to the value in D3 at once and return something to a single cell?
If you are trying to compare one cell at a time, then use a single cell reference, i.e.
Code:
[COLOR=#333333]=IF(AND(J1>=$D$3,...[/COLOR]
 
Upvote 0
I am trying to determine where repair jobs have been raised separately but should in reality be consolidated into one.

Each line of the work sheet contains a separate job, I need to determine if.

1. Job type matches another
2. The estimated completion date falls within the same date range as another (so could be completed at the same time)
3. The status i.e complete or scheduled is the same as another
4. The address matches another job

If the answer to each of these is yes then I know the jobs should be combined.
 
Upvote 0
I think it would be beneficial if we could see a sampling of your data and expected results.

You cannot upload files to this site. But there are tools you can use to post screen images. They are listed in Section B of this link here: http://www.mrexcel.com/forum/board-a...forum-use.html.
Also, there is a Test Here forum on this board that you can use to test out these tools to make sure they are working correctly before using them in your question.
 
Upvote 0
Thank you, does this help? I've labeled the columns

A
CDEFGIJ
Repairs Request RefADDRESS_LINE_1DATE_LOGGEDSTD_JOB_DESCRIPTIONPRIORITYSTATUSComplete by?COMPLETION_DATE
43477391- 18, COCHRANE HOUSE 19, TRUESDALES13/06/2017Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete04/07/201719/06/2017
43049111-11 (BLOCK B4) WYATT COURT FARLEY FIELDS18/05/2017Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete08/06/201731/05/2017
42661871-11 (BLOCK B4) WYATT COURT FARLEY FIELDS25/04/2017Door (external) - replace60 DaysJob Scheduled18/07/2017(blank)
43382171-11 (BLOCK B4) WYATT COURT FARLEY FIELDS07/06/2017Door Entry Electric System- repair/ replaceReactive - Average 15 working daysJob Complete28/06/201720/06/2017
42624161-11 (BLOCK B4) WYATT COURT FARLEY FIELDS24/04/2017Door External (timber) - repair24 Hour EmergencyJob Complete25/04/201724/04/2017
41880181-11 (BLOCK B4) WYATT COURT FARLEY FIELDS13/03/2017Door External (UPVC) - repairReactive - Average 15 working daysJob Complete03/04/201716/03/2017
39673801-11 (BLOCK B4) WYATT COURT FARLEY FIELDS10/11/2016Drain Blockage - clear as per agreed rateReactive - Average 15 working daysJob Complete01/12/201608/12/2016
40522891-11 (BLOCK B4) WYATT COURT FARLEY FIELDS31/12/2016Drain Blockage - clear as per agreed rate24 Hour EmergencyJob Complete01/01/201704/04/2017
41437311-11 (BLOCK B4) WYATT COURT FARLEY FIELDS17/02/2017Drain Blockage - clear as per agreed rate24 Hour EmergencyJob Complete18/02/201718/02/2017
42130711-11 (BLOCK B4) WYATT COURT FARLEY FIELDS27/03/2017LightsReactive - Average 15 working daysJob Complete17/04/201728/03/2017
43921221-11 (BLOCK B4) WYATT COURT FARLEY FIELDS08/07/2017Out of Hours - Electrics24 Hour EmergencyJob Complete09/07/201708/07/2017
41942631-20 (BLOCK C1) BAGSHAWE COURT FARLEY FIELDS15/03/2017Communal Lift - repair24 Hour EmergencyJob Complete16/03/201722/03/2017
41942711-20 (BLOCK C1) BAGSHAWE COURT FARLEY FIELDS15/03/2017Communal Lighting - repair multiple lightsReactive - Average 15 working daysJob Complete05/04/201728/03/2017
43071551-20 (BLOCK C1) BAGSHAWE COURT FARLEY FIELDS19/05/2017Gate - repair/ refix inc latchesReactive - Average 15 working daysJob Complete09/06/201714/06/2017
43071131-20 (BLOCK C1) BAGSHAWE COURT FARLEY FIELDS19/05/2017Skirting/ Architrave - repairReactive - Average 15 working daysJob Complete09/06/201706/06/2017
43071211-20 (BLOCK C1) BAGSHAWE COURT FARLEY FIELDS19/05/2017Window (single glazed) - measureReactive - Average 15 working daysJob Complete09/06/201702/06/2017
43020061-20 (BLOCK C1) BAGSHAWE COURT FARLEY FIELDS17/05/2017Work from service visitReactive - Average 15 working daysJob Complete07/06/201724/05/2017
436205012-19 (BLOCK B3) WYATT COURT FARLEY FIELDS21/06/2017Communal Lighting - repair multiple lights24 Hour EmergencyJob Complete22/06/201721/06/2017
430686812-19 (BLOCK B3) WYATT COURT FARLEY FIELDS19/05/2017Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete09/06/201731/05/2017
430688412-19 (BLOCK B3) WYATT COURT FARLEY FIELDS19/05/2017Door Closer - repairReactive - Average 15 working daysJob Complete09/06/201706/06/2017
422322812-19 (BLOCK B3) WYATT COURT FARLEY FIELDS31/03/2017Door Entry Electric System- repair/ replaceReactive - Average 15 working daysJob Complete21/04/201710/04/2017
430687612-19 (BLOCK B3) WYATT COURT FARLEY FIELDS19/05/2017Door Entry Electric System- repair/ replaceReactive - Average 15 working daysJob Complete09/06/201719/06/2017

<tbody>
</tbody><colgroup><col><col><col><col><col><col><col><col></colgroup>
 
Upvote 0
OK, now based on that data sample, can you walk us through one of the records, and explain exactly what should happen to that record and why?
Where I am getting confused from your earlier posts is that I cannot tell what should be contained to the single line/record you are looking at versus the whole set of data. So if you can walk us through an actual example, it may become clearer to us how you want this to work.
 
Upvote 0
Thank you for you patience, I'm aware that I'm not really being very clear! I've provided a smaller sample which contains a record I would expect to flag up.

Ok, I am trying to identify where I can make efficiency savings by sending one contractor out instead of 2/3 by identifying where the same job is currently booked to be attended to in the future.

For the records highlight red I would want to return a "yes" because:

1. The address Matches
2. As you can see the job scheduled to be completed on the 26/4/17 could in theory be done during the visit on the 25/4/17. I want to highlight that there is already a job of the same type (column E) so that they can be grouped together. I could add in whether a job is scheduled or complete if it would help? As obviously if the previous job has been completed already then I can't combine them.
3. Priority status is the same, i.e. both "Reactive - Average 15 working days"
4. It's for the same address
5. It's the same job type "Communal Lighting - repair single light"

The other records are not repeated and don't meet the above criteria so should not be flagged.

Does that help in anyway?

ACDEFGIJ
Repairs Request RefADDRESS_LINE_1DATE_LOGGEDSTD_JOB_DESCRIPTIONPRIORITYSTATUSComplete by?COMPLETION_DATE
4241759BLOCK 1-18 TANTON HOUSE WINSLOW FIELD12/04/2017Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete03/05/201725/04/2017
4268646BLOCK 1-18 TANTON HOUSE WINSLOW FIELD26/04/2017Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete17/05/201726/04/2017
4238285BLOCK 12-22 GREAT BEANHILLS10/04/2017Communal Lighting - repair multiple lightsReactive - Average 15 working daysJob Complete01/05/201704/05/2017
4348159BLOCK 1-23, OSBORN HOUSE HOWARDSGATE13/06/2017Communal Lighting - repair multiple lightsReactive - Average 15 working daysJob Complete04/07/201719/06/2017
4268373BLOCK 1-24 ATLAS HOUSE. BELLINGDON ROAD26/04/2017Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete17/05/201702/05/2017
4240272BLOCK 1-29 GOWER HOUSE THE GOWERS11/04/2017Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete02/05/201724/04/2017
4241840BLOCK 129-141 (ODD) WRIGHTS LANE12/04/2017Communal Lighting - repair multiple lightsReactive - Average 15 working daysJob Complete03/05/201712/04/2017

<tbody>
</tbody><colgroup><col><col><col><col><col><col><col><col></colgroup>
 
Upvote 0
I think that is going to be a bit more complex than just a regular formula, because it is not enough that there are other entries in the same column that match the entry, but all those row numbers need to match too.

For example, if you look at Job Description, it is not enough that "Communal Lighting - repair single light" is found multiple times in that column, it has to appear multiple in conjunction with the other field (like Address) being the same also.

I think something like that is either going to take some complex array formula, or VBA. If it were me, I would probably write VBA code to sort through the data and then loop through all the records.
 
Upvote 0
Maybe a COUNTIFS could work?

ABCDEFGHIJK
1Repairs Request RefADDRESS_LINE_1DATE_LOGGEDSTD_JOB_DESCRIPTIONPRIORITYSTATUSComplete by?COMPLETION_DATE
24241759BLOCK 1-18 TANTON HOUSE WINSLOW FIELD######Communal Lighting - repair single lightReactive - Average 15 working daysScheduled3/5/201725/04/2017Can bundle
34268646BLOCK 1-18 TANTON HOUSE WINSLOW FIELD26/04/2017Communal Lighting - repair single lightReactive - Average 15 working daysScheduled17/05/201726/04/2017Can bundle
44238285BLOCK 12-22 GREAT BEANHILLS######Communal Lighting - repair multiple lightsReactive - Average 15 working daysJob Complete1/5/20174/5/2017
54348159BLOCK 1-23, OSBORN HOUSE HOWARDSGATE13/06/2017Communal Lighting - repair multiple lightsReactive - Average 15 working daysJob Complete4/7/201719/06/2017
64268373BLOCK 1-24 ATLAS HOUSE. BELLINGDON ROAD26/04/2017Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete17/05/20172/5/2017
74240272BLOCK 1-29 GOWER HOUSE THE GOWERS######Communal Lighting - repair single lightReactive - Average 15 working daysJob Complete2/5/201724/04/2017
84241840BLOCK 129-141 (ODD) WRIGHTS LANE######Communal Lighting - repair multiple lightsReactive - Average 15 working daysJob Complete3/5/2017######

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet8

Worksheet Formulas
CellFormula
K2=IF(COUNTIFS(C:C,C2,E:E,E2,F:F,F2,G:G,"*schedule*")>1,"Can bundle","")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>


This checks for jobs that match address, description, priority, and are still scheduled. If we have multiple matches, you'll get the message. If the jobs are not adjacent, it might be tougher to identify the matches though.
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,466
Members
449,086
Latest member
kwindels

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