How to Replace blank cell with specific value

manoj_arsul

Board Regular
Joined
Jun 27, 2018
Messages
52
I want program for below condition

1. filter to column "D" for blank .
2. Replace all blank cell in column "D" with Not OK.
3. Clear Filter .
4. filter to column "D" for Not OK.
5. filter to column "A" for Pending.
6. Replace all these pending As Pending - Not OK

Example is
Row Data
<style type="text/css"> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small } </style>
Status*CityCountryTest
PendingPuneIndiaOk
PendingMumbaiIndiaOk
PendingLondonEngland
PendingPuneIndia
PendingMumbaiIndiaOk
PendingMumbaiIndia
PendingLondonEngland
PendingPuneIndia
Waiting LondonEnglandOk
Waiting PuneIndiaOk
Waiting MumbaiIndia
Waiting LondonEngland
Waiting PuneIndiaOk
WorkingMumbaiIndiaOk
WorkingLondonEngland
WorkingPuneIndiaOk
WorkingMumbaiIndiaOk
ClosedLondonEngland
ClosedLondonEngland
ClosedPuneIndia
ClosedMumbaiIndia
ClosedLondonEnglandOk
ClosedPuneIndiaOk
ClosedMumbaiIndia
ClosedLondonEngland

<tbody>
</tbody>

Out Put :

<style type="text/css"> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small } </style>
Status*CityCountryTest
PendingPuneIndiaOk
PendingMumbaiIndiaOk
Pending - Not OKLondonEnglandNot OK
Pending - Not OKPuneIndiaNot OK
PendingMumbaiIndiaOk
Pending - Not OKMumbaiIndiaNot OK
Pending - Not OKLondonEnglandNot OK
Pending - Not OKPuneIndiaNot OK
Waiting LondonEnglandOk
Waiting PuneIndiaOk
Waiting MumbaiIndiaNot OK
Waiting LondonEnglandNot OK
Waiting PuneIndiaOk
WorkingMumbaiIndiaOk
WorkingLondonEnglandNot OK
WorkingPuneIndiaOk
WorkingMumbaiIndiaOk
ClosedLondonEnglandNot OK
ClosedLondonEnglandNot OK
ClosedPuneIndiaNot OK
ClosedMumbaiIndiaNot OK
ClosedLondonEnglandOk
ClosedPuneIndiaOk
ClosedMumbaiIndiaNot OK
ClosedLondonEnglandNot OK

<tbody>
</tbody>



 
Last edited by a moderator:

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,185
Office Version
365
Platform
Windows
How about
Code:
Sub NotOk()
   With Range("A2", Range("A" & Rows.Count).End(xlUp))
      .Offset(, 3).SpecialCells(xlBlanks).Value = "Not OK"
      .Value = Evaluate(Replace(Replace("if((@=""Pending"")*(@d=""Not OK""),""Pending-Not OK"",@)", "@d", .Offset(, 3).Address), "@", .Address))
   End With
End Sub
 

manoj_arsul

Board Regular
Joined
Jun 27, 2018
Messages
52
How about
Code:
Sub NotOk()
   With Range("A2", Range("A" & Rows.Count).End(xlUp))
      .Offset(, 3).SpecialCells(xlBlanks).Value = "Not OK"
      .Value = Evaluate(Replace(Replace("if((@=""Pending"")*(@d=""Not OK""),""Pending-Not OK"",@)", "@d", .Offset(, 3).Address), "@", .Address))
   End With
End Sub
Thank u @Fluff
 
Last edited by a moderator:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,185
Office Version
365
Platform
Windows
You're welcome
 

manoj_arsul

Board Regular
Joined
Jun 27, 2018
Messages
52
I want one more program for the below condition.(Last 5 Days Count City wise .)


1) Filter to Column "A" Status For Working .
2) Filter to Column "B" City For Pune.
3) Get Till date (Today) Count of column "A" in the cell of table ( Today 19th)
4) Filter Today()-1 & Get date Count of column "A" in the cell of table ( 18th July)
5) Filter Today()-2 & Get date Count of column "A" in the cell of table ( 17th July)
6) Filter Today()-3 & Get date Count of column "A" in the cell of table ( 16th July)
7) Filter Today()-4 & Get date Count of column "A" in the cell of table ( 15th July)

Do the Same condition with other Pending , Pending - Not OK , Waiting

Source Data: -
<style type="text/css"> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small } </style>
Status*CityCountryTestDate
Pending Pune India Ok19-Jul-18
Pending Mumbai India Ok17-Jun-18
Pending - Not OK London England Not OK16-May-18
Pending - Not OK Pune India Not OK15-Jul-18
Pending Mumbai India Ok18-Jul-18
Pending - Not OK Mumbai India Not OK19-Jul-18
Pending - Not OK London England Not OK17-Jul-18
Pending - Not OK Pune India Not OK16-Jul-18
Waiting London England Ok15-Feb-18
Waiting Pune India Ok18-Jul-18
Waiting Mumbai India Not OK19-Jul-18
Waiting London England Not OK17-Jul-18
Waiting Pune India Ok16-Jun-18
Working Mumbai India Ok5-Mar-18
Working London England Not OK18-Jul-18
Working Pune India Ok19-Jul-18
Working Pune India Ok17-Mar-18
Closed London England Not OK16-Jul-18
Closed London England Not OK15-Jul-18
Closed Pune India Not OK18-Jul-18
Closed Mumbai India Not OK19-Jul-18
Closed London England Ok17-Jul-18
Closed Pune India Ok16-Jul-18
Closed Mumbai India Not OK15-Jul-18
Closed London England Not OK18-Jul-18

<tbody>
</tbody>


Out Put :

<style type="text/css"> body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Calibri"; font-size:x-small } </style>
PuneWorking Count Pending CountPending - Not OKWaiting Count
15-Jul-180010
16-Jul-180021
17-Jul-181021
18-Jul-181022
19-Jul-182122

<tbody>
</tbody>



 
Last edited by a moderator:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,185
Office Version
365
Platform
Windows
As this is a completely different question, please start a new thread.
But before you do, I do not know where you are copy/pasting your posts from, but please do not do it. It normally occurs when you are pasting a table. if you follow the link in my signature you will tools to help with that.
I have had to clean a lot of them up as they are so small as to be virtually unreadable.
You can use the test board to check that things are working properly before starting a new thread
 
Last edited:

manoj_arsul

Board Regular
Joined
Jun 27, 2018
Messages
52
ok Fluff I am going to raise new Thread for the same .

And this is not copy paste Question . Only I am going to same source data ( only for reference ).

Thank you Again !!!
 

Watch MrExcel Video

Forum statistics

Threads
1,090,548
Messages
5,415,192
Members
403,571
Latest member
twinlock

This Week's Hot Topics

Top