Counting if few conditions are met until further condition is met starting from last entry

StevanBgd

New Member
Joined
Mar 29, 2021
Messages
1
Office Version
  1. 2007
Platform
  1. Windows
Hello everyone,
I am using Excel 2007 on Windows 10 and have some troubles with counting in excel. I will explain it in example:
DATE 1ST 2ND SHIPMENT
01.01.2020 Apple Banana yes
01.02.2020 Banana Apple yes
01.03.2020 Orange Banana no
01.04.2020 Apple Orange no
01.05.2020 Apple Orange yes
01.06.2020 Orange Banana yes
01.07.2020 Banana Apple yes
01.08.2020 Apple Orange yes
01.09.2020 Apple Banana yes
01.10.2020 Banana Apple yes
01.11.2020 Apple Banana yes
01.12.2020 Apple Orange no

I want to count several things:
1) how many times combination "apple" in column 1ST and "yes" in column SHIPMENT appears until column SHIPMENT turns "No" starting from last entered combination?
2) how many times combination "apple" in column 2ST and "yes" in column SHIPMENT appears until column SHIPMENT turns "No" starting from last entered combination?
3) how many times combination "apple" in column 1ST or column 2ND and "yes" in column SHIPMENT appears until column SHIPMENT turns "No" starting from last entered combination?
Example is also attached as mini-sheet.
Thank you for help.
Kind regards

Counting mini-sheet.xlsx
ABCDEFGHIJKL
1DATE1ST2NDSHIPMENTNumber of consecutive "yes"Number of consecutive "no"
201.01.2020AppleBananayes1ST2NDBOTH1ST2NDBOTH
301.02.2020BananaAppleyesapple
401.03.2020OrangeBanananobanana
501.04.2020AppleOrangenoorange
601.05.2020AppleOrangeyes
701.06.2020OrangeBananayes
801.07.2020BananaAppleyes
901.08.2020AppleOrangeyes
1001.09.2020AppleBananayes
1101.10.2020BananaAppleyes
1201.11.2020AppleBananayes
1301.12.2020AppleOrangeno
Sheet1
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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