# How to replace "" with blank?

**URL:** <https://community.wolfram.com/t/how-to-replace-with-blank/19788>\
**Category:** Questions\
**Tags:** data-science\
**Created:** [March 22, 2022, 5:01am UTC](https://community.wolfram.com/t/how-to-replace-with-blank/19788 "2022-03-22T05:01:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhenyuzeng](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zhenyuzeng](https://community.wolfram.com/u/zhenyuzeng)\
**Post date:** [March 22, 2022, 5:01am UTC](https://community.wolfram.com/t/how-to-replace-with-blank/19788/1 "2022-03-22T05:01:11Z")

</div>

Hello,  
In my Excel file, some results are **`=""`**  
So, when I import it to Mathematica, these **`=""`** will show blank. But When I calculate with, these =“” can calculate! So how can I replace “” with blank in Mathematica

```
d=Dataset@{<|"a" -> "", "b" -> 0.869667, "c" -> 0.069534|>, <|"a" -> 0.906971, 
  "b" -> 0.614134, "c" -> 0.943003|>, <|"a" -> 0.46762, 
  "b" -> 0.619722, "c" -> 0.237383|>, <|"a" -> 0.0532133, "b" -> "", 
  "c" -> 0.160852|>, <|"a" -> 0.968014, "b" -> 0.609222, 
  "c" -> 0.522014|>, <|"a" -> 0.331874, "b" -> 0.0132003, 
  "c" -> 0.175512|>, <|"a" -> 0.274197, "b" -> 0.892181, 
  "c" -> 0.560612|>, <|"a" -> 0.20482, "b" -> 0.503641, 
  "c" -> 0.456528|>, <|"a" -> 0.607325, "b" -> 0.972514, 
  "c" -> 0.468308|>, <|"a" -> 0.726064, "b" -> 0.976656, 
  "c" -> 0.166471|>, <|"a" -> 0.576529, "b" -> 0.418368, 
  "c" -> 0.422449|>, <|"a" -> 0.935738, "b" -> 0.730028, 
  "c" -> 0.518465|>, <|"a" -> 0.167812, "b" -> 0.49489, 
  "c" -> 0.18876|>, <|"a" -> 0.487007, "b" -> 0.632814, 
  "c" -> 0.607625|>, <|"a" -> 0.542796, "b" -> 0.818752, 
  "c" -> 0.915069|>, <|"a" -> 0.21409, "b" -> 0.443561, 
  "c" -> 0.923162|>};
g = 5*(Normal[d[All, "a"]][[1]])

```

The result is 5. I want to this “” can’t be calculated.  
Thanks.

---

<div class="post-metadata">

**Author:** ![eric3](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/eric3/32/12760_2.png) [@eric3](https://community.wolfram.com/u/eric3)\
**Post date:** [March 22, 2022, 11:00am UTC](https://community.wolfram.com/t/how-to-replace-with-blank/19788/2 "2022-03-22T11:00:46Z")

</div>

1. I assume that the missing `[]` in your Dataset is a copy-paste error of some kind.

2. The result isn’t `5`. The result is `Times[5, ""]`.

3. What do you want your result to be? Just saying that you want “” to not be calculated doesn’t help, since it isn’t calculated (I’m assuming that when you say “calcluated” you mean something like “treated numerically”).

4. Once you decide what the semantics of “” should be you can use ReplaceAll. Let’s say you want “” to become Null:

Or maybe you do want everthing to be numeric:

```
    d /. "" -> 0

```

Or maybe you want to be very specific about what “” means in your context:

```
    d /. "" -> Missing["Nonexistent"]

```

Be aware that none of these actually change the value of `d`. You can either store these in a new variable

```
d2 = d /. "" -> Missing["Nonexistent"]

```

or update d itself

```
d = d /. "" -> Missing["Nonexistent"]

```

---

<div class="post-metadata">

**Author:** ![robertnowak](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/robertnowak/32/35992_2.png) [@robertnowak](https://community.wolfram.com/u/robertnowak)\
**Post date:** [March 22, 2022, 11:08am UTC](https://community.wolfram.com/t/how-to-replace-with-blank/19788/3 "2022-03-22T11:08:48Z")

</div>

Hi

First there is a syntax error. Either there is a missing “@” or a missing pair of brackets “[]”.  
The result you get is not 5 it just looks like a five actually it is 5 \* “” which is not a numeric value.

Next you need to decide which value to use when replacing “” e.g. 0.

Maybe this is what you are looking for:

```
In[9]:= d = 
  Dataset@{<|"a" -> "", "b" -> 0.869667, "c" -> 0.069534|>, <|
      "a" -> 0.906971, "b" -> 0.614134, "c" -> 0.943003|>, <|
      "a" -> 0.46762, "b" -> 0.619722, "c" -> 0.237383|>, <|
      "a" -> 0.0532133, "b" -> "", "c" -> 0.160852|>, <|
      "a" -> 0.968014, "b" -> 0.609222, "c" -> 0.522014|>, <|
      "a" -> 0.331874, "b" -> 0.0132003, "c" -> 0.175512|>, <|
      "a" -> 0.274197, "b" -> 0.892181, "c" -> 0.560612|>, <|
      "a" -> 0.20482, "b" -> 0.503641, "c" -> 0.456528|>, <|
      "a" -> 0.607325, "b" -> 0.972514, "c" -> 0.468308|>, <|
      "a" -> 0.726064, "b" -> 0.976656, "c" -> 0.166471|>, <|
      "a" -> 0.576529, "b" -> 0.418368, "c" -> 0.422449|>, <|
      "a" -> 0.935738, "b" -> 0.730028, "c" -> 0.518465|>, <|
      "a" -> 0.167812, "b" -> 0.49489, "c" -> 0.18876|>, <|
      "a" -> 0.487007, "b" -> 0.632814, "c" -> 0.607625|>, <|
      "a" -> 0.542796, "b" -> 0.818752, "c" -> 0.915069|>, <|
      "a" -> 0.21409, "b" -> 0.443561, "c" -> 0.923162|>} /. "" -> 0;
g = 5*(Normal[d[All, "a"]][[1]])

Out[10]= 0

```

Robert

---

<div class="post-metadata">

**Author:** ![zhenyuzeng](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zhenyuzeng](https://community.wolfram.com/u/zhenyuzeng)\
**Post date:** [March 23, 2022, 5:35am UTC](https://community.wolfram.com/t/how-to-replace-with-blank/19788/4 "2022-03-23T05:35:48Z")

</div>

Hello,  
Thanks for your reply. I find documents in Mathematica, but I can’t find detailed information about Missing. I feel that you know more than documents about Missing. Of course, I will use Missing in the future when I want to keep something empty.

---

<div class="post-metadata">

**Author:** ![zhenyuzeng](https://avatars.discourse-cdn.com/v4/letter/z/ecb155/32.png) [@zhenyuzeng](https://community.wolfram.com/u/zhenyuzeng)\
**Post date:** [March 23, 2022, 5:37am UTC](https://community.wolfram.com/t/how-to-replace-with-blank/19788/5 "2022-03-23T05:37:19Z")

</div>

Hello,  
Thanks for your reply. Your answer is certainly what I wanted.  
Have a nice day!

---

<div class="post-metadata">

**Author:** ![eric3](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/eric3/32/12760_2.png) [@eric3](https://community.wolfram.com/u/eric3)\
**Post date:** [March 23, 2022, 5:48pm UTC](https://community.wolfram.com/t/how-to-replace-with-blank/19788/6 "2022-03-23T17:48:52Z")

</div>

> **[Missing—Wolfram Documentation](https://reference.wolfram.com/language/ref/Missing.html)**
>
> Missing\[\] represents data that is missing. Missing\[reason\] specifies a reason for the data's being missing. Missing\[reason, expr\] associates the expression expr with the missing data.
